moved LiveSupport::Storage::StorageException and derivatives to

LiveSupport::Core::XmlRpcException
This commit is contained in:
maroy 2005-01-08 12:40:33 +00:00
parent a08d2b4dcd
commit 4eac8957fd
31 changed files with 1139 additions and 451 deletions

View File

@ -20,8 +20,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# #
# Author : $Author: fgerlits $ # Author : $Author: maroy $
# Version : $Revision: 1.21 $ # Version : $Revision: 1.22 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $
# #
# @configure_input@ # @configure_input@
@ -118,7 +118,8 @@ CORE_LIB_OBJS = ${TMP_DIR}/UniqueId.o \
${TMP_DIR}/LocalizedObject.o \ ${TMP_DIR}/LocalizedObject.o \
${TMP_DIR}/LocalizedConfigurable.o \ ${TMP_DIR}/LocalizedConfigurable.o \
${TMP_DIR}/Md5.o \ ${TMP_DIR}/Md5.o \
${TMP_DIR}/XmlRpcTools.o ${TMP_DIR}/XmlRpcTools.o \
${TMP_DIR}/XmlRpcException.o
TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \ TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \
${TMP_DIR}/UniqueIdTest.o \ ${TMP_DIR}/UniqueIdTest.o \

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcCommunicationException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcCommunicationException_h
#define LiveSupport_Core_XmlRpcCommunicationException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Exception signaling an XML-RPC communcation problem.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcCommunicationException : public XmlRpcException
{
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcCommunicationException(const std::string &msg) throw ()
: XmlRpcException(msg)
{
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcCommunicationException(const std::exception & parent)
throw ()
: XmlRpcException(parent)
{
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcCommunicationException(const std::string & msg,
const std::exception & parent)
throw ()
: XmlRpcException(msg, parent)
{
}
/**
* Virtual destructor.
*/
~XmlRpcCommunicationException(void) throw ()
{
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcCommunicationException_h

View File

@ -0,0 +1,151 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcException_h
#define LiveSupport_Core_XmlRpcException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <stdexcept>
#include "LiveSupport/Core/Ptr.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Common parent of exception classes for XML-RPC related problems.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcException : public std::exception
{
private:
/**
* The message of the exception.
*/
Ptr<std::string>::Ref message;
/**
* A possible embedded exception.
*/
const std::exception & parent;
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcException(const std::string &msg) throw ()
: parent(*this)
{
message.reset(new std::string(msg));
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcException(const std::exception & parent) throw ()
: parent(parent)
{
message.reset(new std::string(parent.what()));
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcException(const std::string & msg,
const std::exception & parent) throw ();
/**
* Virtual destructor.
*/
~XmlRpcException(void) throw ()
{
}
/**
* Get the message of the exception.
*
* @return the message of the exception.
*/
virtual const char *
what(void) const throw ()
{
return message->c_str();
}
/**
* Get the parent exception.
*
* @return the parent exception, which may be null.
*/
virtual const std::exception *
getParent(void) const throw ()
{
return &parent == this ? 0 : &parent;
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcException_h

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcIOException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcIOException_h
#define LiveSupport_Core_XmlRpcIOException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Exception signaling an XML-RPC I/O problem.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcIOException : public XmlRpcException
{
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcIOException(const std::string &msg) throw ()
: XmlRpcException(msg)
{
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcIOException(const std::exception & parent)
throw ()
: XmlRpcException(parent)
{
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcIOException(const std::string & msg,
const std::exception & parent)
throw ()
: XmlRpcException(msg, parent)
{
}
/**
* Virtual destructor.
*/
~XmlRpcIOException(void) throw ()
{
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcIOException_h

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcInvalidArgumentException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcInvalidArgumentException_h
#define LiveSupport_Core_XmlRpcInvalidArgumentException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Exception signaling an XML-RPC invalid parameter problem.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcInvalidArgumentException : public XmlRpcException
{
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcInvalidArgumentException(const std::string &msg) throw ()
: XmlRpcException(msg)
{
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcInvalidArgumentException(const std::exception & parent)
throw ()
: XmlRpcException(parent)
{
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcInvalidArgumentException(const std::string & msg,
const std::exception & parent)
throw ()
: XmlRpcException(msg, parent)
{
}
/**
* Virtual destructor.
*/
~XmlRpcInvalidArgumentException(void) throw ()
{
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcInvalidArgumentException_h

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcMethodFaultException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcMethodFaultException_h
#define LiveSupport_Core_XmlRpcMethodFaultException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Exception signaling an XML-RPC method call problem.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcMethodFaultException : public XmlRpcException
{
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcMethodFaultException(const std::string &msg) throw ()
: XmlRpcException(msg)
{
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcMethodFaultException(const std::exception & parent)
throw ()
: XmlRpcException(parent)
{
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcMethodFaultException(const std::string & msg,
const std::exception & parent)
throw ()
: XmlRpcException(msg, parent)
{
}
/**
* Virtual destructor.
*/
~XmlRpcMethodFaultException(void) throw ()
{
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcMethodFaultException_h

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/XmlRpcMethodResponseException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_XmlRpcMethodResponseException_h
#define LiveSupport_Core_XmlRpcMethodResponseException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Exception signaling an XML-RPC method response problem.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class XmlRpcMethodResponseException : public XmlRpcException
{
public:
/**
* Constructor based on a string.
*
* @param msg the message of the exception.
*/
XmlRpcMethodResponseException(const std::string &msg) throw ()
: XmlRpcException(msg)
{
}
/**
* Constructor based on a parent exception.
*
* @param parent the parent exception to this one.
*/
XmlRpcMethodResponseException(const std::exception & parent)
throw ()
: XmlRpcException(parent)
{
}
/**
* Constructor based on a message ant a parent exception.
*
* @param msg the message of the exception.
* @param parent the parent exception.
*/
XmlRpcMethodResponseException(const std::string & msg,
const std::exception & parent)
throw ()
: XmlRpcException(msg, parent)
{
}
/**
* Virtual destructor.
*/
~XmlRpcMethodResponseException(void) throw ()
{
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_XmlRpcMethodResponseException_h

View File

@ -0,0 +1,65 @@
/*------------------------------------------------------------------------------
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: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/XmlRpcException.cxx,v $
------------------------------------------------------------------------------*/
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <sstream>
#include "LiveSupport/Core/XmlRpcException.h"
using namespace LiveSupport::Core;
/* =================================================== local data structures */
/* ================================================ local constants & macros */
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
XmlRpcException :: XmlRpcException(const std::string & msg,
const std::exception & parent)
throw ()
: parent(parent)
{
message.reset(new std::string(msg));
message->append("\nparent exception:\n");
message->append(parent.what());
}

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -45,7 +45,7 @@
#include "LiveSupport/Core/UniqueId.h" #include "LiveSupport/Core/UniqueId.h"
#include "LiveSupport/Core/Playlist.h" #include "LiveSupport/Core/Playlist.h"
#include "LiveSupport/Core/SessionId.h" #include "LiveSupport/Core/SessionId.h"
#include "LiveSupport/Storage/StorageException.h" #include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport { namespace LiveSupport {
@ -64,8 +64,8 @@ using namespace Core;
/** /**
* An interface for storage clients. * An interface for storage clients.
* *
* @author $Author: fgerlits $ * @author $Author: maroy $
* @version $Revision: 1.3 $ * @version $Revision: 1.4 $
*/ */
class StorageClientInterface class StorageClientInterface
{ {
@ -77,13 +77,13 @@ class StorageClientInterface
* @param id the id of the playlist to check for. * @param id the id of the playlist to check for.
* @return true if a playlist with the specified id exists, * @return true if a playlist with the specified id exists,
* false otherwise. * false otherwise.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual const bool virtual const bool
existsPlaylist(Ptr<SessionId>::Ref sessionId, existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -92,14 +92,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId, getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -108,14 +108,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId, editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -123,14 +123,14 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to save. * @param playlist the playlist to save.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has not been * call or the playlist has not been
* previously opened by getPlaylist() * previously opened by getPlaylist()
*/ */
virtual void virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId, savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -141,14 +141,14 @@ class StorageClientInterface
* @return a new Playlist instance containing a uri field which * @return a new Playlist instance containing a uri field which
* points to an executable (playable) SMIL representation of * points to an executable (playable) SMIL representation of
* the playlist (in the local storage). * the playlist (in the local storage).
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* specified id exists. * specified id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId, acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -157,28 +157,28 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field, * call or the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
* Delete a playlist with the specified id. * Delete a playlist with the specified id.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted. * @param id the id of the playlist to be deleted.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual void virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId, deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -186,12 +186,12 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return a vector containing the playlists. * @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
getAllPlaylists(Ptr<SessionId>::Ref sessionId) const getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -199,12 +199,12 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return the newly created playlist. * @return the newly created playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
createPlaylist(Ptr<SessionId>::Ref sessionId) createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -214,13 +214,13 @@ class StorageClientInterface
* @param id the id of the audio clip to check for. * @param id the id of the audio clip to check for.
* @return true if an audio clip with the specified id exists, * @return true if an audio clip with the specified id exists,
* false otherwise. * false otherwise.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual const bool virtual const bool
existsAudioClip(Ptr<SessionId>::Ref sessionId, existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -229,14 +229,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return. * @param id the id of the audio clip to return.
* @return the requested audio clip. * @return the requested audio clip.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the * call or no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId, getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -245,13 +245,13 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the audio clip to store. * @param audioClip the audio clip to store.
* *
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or we have not logged in yet. * call or we have not logged in yet.
*/ */
virtual void virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -261,14 +261,14 @@ class StorageClientInterface
* @param id the id of the audio clip to acquire. * @param id the id of the audio clip to acquire.
* @return a new AudioClip instance, containing a uri field which * @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file. * points to (a way of getting) the sound file.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or if no audio clip with the * call or if no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId, acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -276,14 +276,14 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the audio clip has no uri field, * call or the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const Ptr<AudioClip>::Ref audioClip) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -291,14 +291,14 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to be deleted. * @param id the id of the audio clip to be deleted.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the * call or no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual void virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId, deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -306,12 +306,12 @@ class StorageClientInterface
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return a vector containing the playlists. * @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
getAllAudioClips(Ptr<SessionId>::Ref sessionId) const getAllAudioClips(Ptr<SessionId>::Ref sessionId) const
throw (StorageException) throw (XmlRpcException)
= 0; = 0;
}; };

View File

@ -1,137 +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.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/Attic/StorageException.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Storage_StorageException_h
#define LiveSupport_Storage_StorageException_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <stdexcept>
namespace LiveSupport {
namespace Storage {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* Common parent of exception classes for this module.
*
* @author $Author: fgerlits $
* @version $Revision: 1.2 $
*/
class StorageException : public std::runtime_error
{
public:
StorageException(const std::string &msg)
: std::runtime_error(msg) {
}
};
/**
* XML-RPC communication problem.
*/
class XmlRpcCommunicationException : public StorageException
{
public:
XmlRpcCommunicationException(const std::string &msg)
: StorageException(msg) {
}
};
/**
* XML-RPC fault thrown by the method called.
*/
class XmlRpcMethodFaultException : public StorageException
{
public:
XmlRpcMethodFaultException(const std::string &msg)
: StorageException(msg) {
}
};
/**
* Unexpected response from the XML-RPC method.
*/
class XmlRpcMethodResponseException : public StorageException
{
public:
XmlRpcMethodResponseException(const std::string &msg)
: StorageException(msg) {
}
};
/**
* Bad parameter passed to storage client.
*/
class InvalidArgumentException : public StorageException
{
public:
InvalidArgumentException(const std::string &msg)
: StorageException(msg) {
}
};
/**
* Problem with reading or writing local files.
*/
class IOException : public StorageException
{
public:
IOException(const std::string &msg)
: StorageException(msg) {
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Storage
} // namespace LiveSupport
#endif // LiveSupport_Storage_StorageException_h

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/StorageClientFactoryTest.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/StorageClientFactoryTest.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -152,7 +152,7 @@ StorageClientFactoryTest :: firstTest(void)
try { try {
CPPUNIT_ASSERT( storage->existsPlaylist(sessionId, id01)); CPPUNIT_ASSERT( storage->existsPlaylist(sessionId, id01));
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "existsPlaylist returned error:\n"; std::string eMsg = "existsPlaylist returned error:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -161,7 +161,7 @@ StorageClientFactoryTest :: firstTest(void)
try { try {
CPPUNIT_ASSERT(!storage->existsPlaylist(sessionId, id77)); CPPUNIT_ASSERT(!storage->existsPlaylist(sessionId, id77));
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "existsPlaylist returned error:\n"; std::string eMsg = "existsPlaylist returned error:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -171,7 +171,7 @@ StorageClientFactoryTest :: firstTest(void)
Ptr<Playlist>::Ref playlist = storage->getPlaylist(sessionId, id01); Ptr<Playlist>::Ref playlist = storage->getPlaylist(sessionId, id01);
CPPUNIT_ASSERT(playlist->getId()->getId() == id01->getId()); CPPUNIT_ASSERT(playlist->getId()->getId() == id01->getId());
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "getPlaylist returned error:\n"; std::string eMsg = "getPlaylist returned error:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.25 $ Version : $Revision: 1.26 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -42,6 +42,8 @@
#include <fstream> #include <fstream>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include "LiveSupport/Core/XmlRpcInvalidArgumentException.h"
#include "LiveSupport/Core/XmlRpcIOException.h"
#include "TestStorageClient.h" #include "TestStorageClient.h"
using namespace boost::posix_time; using namespace boost::posix_time;
@ -205,12 +207,12 @@ TestStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
PlaylistMap::const_iterator it = playlistMap.find(id->getId()); PlaylistMap::const_iterator it = playlistMap.find(id->getId());
if (it == playlistMap.end()) { if (it == playlistMap.end()) {
throw StorageException("no such playlist"); throw XmlRpcException("no such playlist");
} }
return it->second; return it->second;
@ -223,12 +225,12 @@ TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
PlaylistMap::const_iterator it = playlistMap.find(id->getId()); PlaylistMap::const_iterator it = playlistMap.find(id->getId());
if (it == playlistMap.end()) { if (it == playlistMap.end()) {
throw StorageException("no such playlist"); throw XmlRpcException("no such playlist");
} }
return it->second; return it->second;
@ -252,12 +254,12 @@ TestStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
PlaylistMap::const_iterator playlistMapIt = playlistMap.find(id->getId()); PlaylistMap::const_iterator playlistMapIt = playlistMap.find(id->getId());
if (playlistMapIt == playlistMap.end()) { if (playlistMapIt == playlistMap.end()) {
throw Storage::InvalidArgumentException("no such playlist"); throw XmlRpcInvalidArgumentException("no such playlist");
} }
Ptr<Playlist>::Ref oldPlaylist = playlistMapIt->second; Ptr<Playlist>::Ref oldPlaylist = playlistMapIt->second;
@ -317,7 +319,7 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
++it; ++it;
} }
else { // this should never happen else { // this should never happen
throw Storage::InvalidArgumentException( throw XmlRpcInvalidArgumentException(
"unexpected playlist element type " "unexpected playlist element type "
"(neither audio clip nor playlist)"); "(neither audio clip nor playlist)");
} }
@ -342,16 +344,16 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
void void
TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException) throw (XmlRpcException)
{ {
if (! playlist->getUri()) { if (! playlist->getUri()) {
throw Storage::InvalidArgumentException("playlist URI not found"); throw XmlRpcInvalidArgumentException("playlist URI not found");
} }
std::ifstream ifs(playlist->getUri()->substr(7).c_str()); std::ifstream ifs(playlist->getUri()->substr(7).c_str());
if (!ifs) { // cut of "file://" if (!ifs) { // cut of "file://"
ifs.close(); ifs.close();
throw Storage::IOException("playlist temp file not found"); throw XmlRpcIOException("playlist temp file not found");
} }
ifs.close(); ifs.close();
@ -365,7 +367,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try { try {
releaseAudioClip(sessionId, it->second->getAudioClip()); releaseAudioClip(sessionId, it->second->getAudioClip());
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
eMsg += "\n"; eMsg += "\n";
} }
@ -375,7 +377,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try { try {
releasePlaylist(sessionId, it->second->getPlaylist()); releasePlaylist(sessionId, it->second->getPlaylist());
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
eMsg += "\n"; eMsg += "\n";
} }
@ -391,7 +393,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
if (eMsg != "") { if (eMsg != "") {
eMsg.insert(0, "some playlist elements could not be released:\n"); eMsg.insert(0, "some playlist elements could not be released:\n");
throw Storage::InvalidArgumentException(eMsg); throw XmlRpcInvalidArgumentException(eMsg);
} }
} }
@ -402,11 +404,11 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
void void
TestStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
{ {
// erase() returns the number of entries found & erased // erase() returns the number of entries found & erased
if (!playlistMap.erase(id->getId())) { if (!playlistMap.erase(id->getId())) {
throw StorageException("no such playlist"); throw XmlRpcException("no such playlist");
} }
} }
@ -474,12 +476,12 @@ TestStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref Ptr<AudioClip>::Ref
TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
AudioClipMap::const_iterator it = audioClipMap.find(id->getId()); AudioClipMap::const_iterator it = audioClipMap.find(id->getId());
if (it == audioClipMap.end()) { if (it == audioClipMap.end()) {
throw StorageException("no such audio clip"); throw XmlRpcException("no such audio clip");
} }
return it->second; return it->second;
@ -492,7 +494,7 @@ TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
void void
TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (XmlRpcException)
{ {
if (!audioClip->getId()) { if (!audioClip->getId()) {
audioClip->setId(UniqueId::generateId()); audioClip->setId(UniqueId::generateId());
@ -508,18 +510,18 @@ TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref Ptr<AudioClip>::Ref
TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
AudioClipMap::const_iterator it = audioClipMap.find(id->getId()); AudioClipMap::const_iterator it = audioClipMap.find(id->getId());
if (it == audioClipMap.end()) { if (it == audioClipMap.end()) {
throw StorageException("no such audio clip"); throw XmlRpcException("no such audio clip");
} }
Ptr<AudioClip>::Ref storedAudioClip = it->second; Ptr<AudioClip>::Ref storedAudioClip = it->second;
if (! storedAudioClip->getUri()) { if (! storedAudioClip->getUri()) {
throw StorageException("audio clip URI not found"); throw XmlRpcException("audio clip URI not found");
} }
// cut the "file:" off // cut the "file:" off
std::string audioClipFileName = storedAudioClip->getUri()->substr(5); std::string audioClipFileName = storedAudioClip->getUri()->substr(5);
@ -527,7 +529,7 @@ TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
std::ifstream ifs(audioClipFileName.c_str()); std::ifstream ifs(audioClipFileName.c_str());
if (!ifs) { if (!ifs) {
ifs.close(); ifs.close();
throw StorageException("could not read audio clip"); throw XmlRpcException("could not read audio clip");
} }
ifs.close(); ifs.close();
@ -549,10 +551,10 @@ TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
void void
TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const Ptr<AudioClip>::Ref audioClip) const
throw (StorageException) throw (XmlRpcException)
{ {
if (*(audioClip->getUri()) == "") { if (*(audioClip->getUri()) == "") {
throw StorageException("audio clip URI not found"); throw XmlRpcException("audio clip URI not found");
} }
Ptr<std::string>::Ref nullPointer; Ptr<std::string>::Ref nullPointer;
@ -566,11 +568,11 @@ TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
void void
TestStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
{ {
// erase() returns the number of entries found & erased // erase() returns the number of entries found & erased
if (!audioClipMap.erase(id->getId())) { if (!audioClipMap.erase(id->getId())) {
throw StorageException("no such audio clip"); throw XmlRpcException("no such audio clip");
} }
} }

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.21 $ Version : $Revision: 1.22 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -89,8 +89,8 @@ using namespace LiveSupport::Core;
* &lt;!ATTLIST testStorage tempFiles CDATA #REQUIRED &gt; * &lt;!ATTLIST testStorage tempFiles CDATA #REQUIRED &gt;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: maroy $
* @version $Revision: 1.21 $ * @version $Revision: 1.22 $
*/ */
class TestStorageClient : class TestStorageClient :
virtual public Configurable, virtual public Configurable,
@ -183,13 +183,13 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if no playlist with the specified * @exception XmlRpcException if no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId, getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -198,13 +198,13 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if no playlist with the specified * @exception XmlRpcException if no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId, editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -232,13 +232,13 @@ class TestStorageClient :
* @return a new Playlist instance containing a uri field which * @return a new Playlist instance containing a uri field which
* points to an executable (playable) SMIL representation of * points to an executable (playable) SMIL representation of
* the playlist (in the local storage). * the playlist (in the local storage).
* @exception StorageException if no playlist with the specified * @exception XmlRpcException if no playlist with the specified
* specified id exists. * specified id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId, acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -247,26 +247,26 @@ class TestStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception StorageException if the playlist has no uri field, * @exception XmlRpcException if the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Delete a playlist with the specified id. * Delete a playlist with the specified id.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted. * @param id the id of the playlist to be deleted.
* @exception StorageException if no playlist with the specified * @exception XmlRpcException if no playlist with the specified
* id exists. * id exists.
*/ */
virtual void virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId, deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException); throw (XmlRpcException);
/** /**
@ -310,13 +310,13 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return. * @param id the id of the audio clip to return.
* @return the requested audio clip. * @return the requested audio clip.
* @exception StorageException if no audio clip with the * @exception XmlRpcException if no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId, getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Store an audio clip. * Store an audio clip.
@ -324,12 +324,12 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the audio clip to store. * @param audioClip the audio clip to store.
* *
* @exception StorageException if we have not logged in yet. * @exception XmlRpcException if we have not logged in yet.
*/ */
virtual void virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException); throw (XmlRpcException);
/** /**
* Acquire the resources for the audio clip with the specified id. * Acquire the resources for the audio clip with the specified id.
@ -343,13 +343,13 @@ class TestStorageClient :
* @param id the id of the audio clip to acquire. * @param id the id of the audio clip to acquire.
* @return a new AudioClip instance, containing a uri field which * @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file. * points to (a way of getting) the sound file.
* @exception StorageException if no audio clip with the * @exception XmlRpcException if no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId, acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -357,13 +357,13 @@ class TestStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception StorageException if the audio clip has no uri field, * @exception XmlRpcException if the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const Ptr<AudioClip>::Ref audioClip) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -371,13 +371,13 @@ class TestStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to be deleted. * @param id the id of the audio clip to be deleted.
* @exception StorageException if no audio clip with the * @exception XmlRpcException if no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual void virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId, deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException); throw (XmlRpcException);
/** /**

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.19 $ Version : $Revision: 1.20 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -135,17 +135,17 @@ TestStorageClientTest :: deletePlaylistTest(void)
try { try {
tsc->deletePlaylist(dummySessionId, id2); tsc->deletePlaylist(dummySessionId, id2);
CPPUNIT_FAIL("allowed to delete non-existent playlist"); CPPUNIT_FAIL("allowed to delete non-existent playlist");
} catch (StorageException &e) { } catch (XmlRpcException &e) {
} }
try { try {
tsc->deletePlaylist(dummySessionId, id1); tsc->deletePlaylist(dummySessionId, id1);
} catch (StorageException &e) { } catch (XmlRpcException &e) {
CPPUNIT_FAIL("cannot delete existing playlist"); CPPUNIT_FAIL("cannot delete existing playlist");
} }
try { try {
tsc->deletePlaylist(dummySessionId, id1); tsc->deletePlaylist(dummySessionId, id1);
CPPUNIT_FAIL("allowed to delete non-existent playlist"); CPPUNIT_FAIL("allowed to delete non-existent playlist");
} catch (StorageException &e) { } catch (XmlRpcException &e) {
} }
} }
@ -235,7 +235,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
try { try {
audioClip = tsc->acquireAudioClip(dummySessionId, id2); audioClip = tsc->acquireAudioClip(dummySessionId, id2);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "could not acquire audio clip:\n"; std::string eMsg = "could not acquire audio clip:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -248,7 +248,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
try { try {
tsc->releaseAudioClip(dummySessionId, audioClip); tsc->releaseAudioClip(dummySessionId, audioClip);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "could not release audio clip:\n"; std::string eMsg = "could not release audio clip:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -258,7 +258,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
audioClip = tsc->acquireAudioClip(dummySessionId, id77); audioClip = tsc->acquireAudioClip(dummySessionId, id77);
CPPUNIT_FAIL("allowed to acquire non-existent audio clip"); CPPUNIT_FAIL("allowed to acquire non-existent audio clip");
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
} }
} }
@ -277,7 +277,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
try { try {
playlist = tsc->acquirePlaylist(dummySessionId, id1); playlist = tsc->acquirePlaylist(dummySessionId, id1);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "could not acquire playlist:\n"; std::string eMsg = "could not acquire playlist:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -296,7 +296,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
try { try {
tsc->releasePlaylist(dummySessionId, playlist); tsc->releasePlaylist(dummySessionId, playlist);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "could not release playlist:\n"; std::string eMsg = "could not release playlist:\n";
eMsg += e.what(); eMsg += e.what();
CPPUNIT_FAIL(eMsg); CPPUNIT_FAIL(eMsg);
@ -313,6 +313,6 @@ TestStorageClientTest :: acquirePlaylistTest(void)
playlist = tsc->acquirePlaylist(dummySessionId, id77); playlist = tsc->acquirePlaylist(dummySessionId, id77);
CPPUNIT_FAIL("allowed to acquire non-existent playlist"); CPPUNIT_FAIL("allowed to acquire non-existent playlist");
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
} }
} }

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.20 $ Version : $Revision: 1.21 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -49,6 +49,11 @@
#include <curl/easy.h> #include <curl/easy.h>
#include "LiveSupport/Core/Md5.h" #include "LiveSupport/Core/Md5.h"
#include "LiveSupport/Core/XmlRpcCommunicationException.h"
#include "LiveSupport/Core/XmlRpcMethodFaultException.h"
#include "LiveSupport/Core/XmlRpcMethodResponseException.h"
#include "LiveSupport/Core/XmlRpcInvalidArgumentException.h"
#include "LiveSupport/Core/XmlRpcIOException.h"
#include "WebStorageClient.h" #include "WebStorageClient.h"
using namespace boost::posix_time; using namespace boost::posix_time;
@ -645,7 +650,7 @@ WebStorageClient :: configure(const xmlpp::Element & element)
const bool const bool
WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -698,7 +703,7 @@ WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -810,7 +815,7 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
Ptr<Playlist>::Ref playlist(new Playlist(id)); Ptr<Playlist>::Ref playlist(new Playlist(id));
Ptr<const std::string>::Ref url, token; Ptr<const std::string>::Ref url, token;
@ -844,7 +849,7 @@ WebStorageClient :: editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id, Ptr<UniqueId>::Ref id,
Ptr<const std::string>::Ref& url, Ptr<const std::string>::Ref& url,
Ptr<const std::string>::Ref& token) const Ptr<const std::string>::Ref& token) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -901,10 +906,10 @@ WebStorageClient :: editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException) throw (XmlRpcException)
{ {
if (!playlist || !playlist->getToken()) { if (!playlist || !playlist->getToken()) {
throw InvalidArgumentException("playlist has no token field"); throw XmlRpcInvalidArgumentException("playlist has no token field");
} }
XmlRpcValue parameters; XmlRpcValue parameters;
@ -969,7 +974,7 @@ WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
Ptr<Playlist>::Ref oldPlaylist = getPlaylist(sessionId, id); Ptr<Playlist>::Ref oldPlaylist = getPlaylist(sessionId, id);
@ -1029,7 +1034,7 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
++it; ++it;
} }
else { // this should never happen else { // this should never happen
throw Storage::InvalidArgumentException( throw XmlRpcInvalidArgumentException(
"unexpected playlist element type " "unexpected playlist element type "
"(neither audio clip nor playlist)"); "(neither audio clip nor playlist)");
} }
@ -1053,16 +1058,16 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException) throw (XmlRpcException)
{ {
if (! playlist->getUri()) { if (! playlist->getUri()) {
throw Storage::InvalidArgumentException("playlist URI not found"); throw XmlRpcInvalidArgumentException("playlist URI not found");
} }
std::ifstream ifs(playlist->getUri()->substr(7).c_str()); std::ifstream ifs(playlist->getUri()->substr(7).c_str());
if (!ifs) { // cut of "file://" if (!ifs) { // cut of "file://"
ifs.close(); ifs.close();
throw Storage::IOException("playlist temp file not found"); throw XmlRpcIOException("playlist temp file not found");
} }
ifs.close(); ifs.close();
@ -1076,7 +1081,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try { try {
releaseAudioClip(sessionId, it->second->getAudioClip()); releaseAudioClip(sessionId, it->second->getAudioClip());
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
eMsg += "\n"; eMsg += "\n";
} }
@ -1086,7 +1091,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try { try {
releasePlaylist(sessionId, it->second->getPlaylist()); releasePlaylist(sessionId, it->second->getPlaylist());
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
eMsg += "\n"; eMsg += "\n";
} }
@ -1102,7 +1107,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
if (eMsg != "") { if (eMsg != "") {
eMsg.insert(0, "some playlist elements could not be released:\n"); eMsg.insert(0, "some playlist elements could not be released:\n");
throw Storage::InvalidArgumentException(eMsg); throw XmlRpcInvalidArgumentException(eMsg);
} }
} }
@ -1113,7 +1118,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1171,7 +1176,7 @@ WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException) throw (XmlRpcException)
{ {
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref playlistVector( Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref playlistVector(
new std::vector<Ptr<Playlist>::Ref>); new std::vector<Ptr<Playlist>::Ref>);
@ -1184,7 +1189,7 @@ WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref Ptr<Playlist>::Ref
WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId) WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1253,7 +1258,7 @@ WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
const bool const bool
WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1306,7 +1311,7 @@ WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref Ptr<AudioClip>::Ref
WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1420,10 +1425,11 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (XmlRpcException)
{ {
if (!audioClip || !audioClip->getUri()) { if (!audioClip || !audioClip->getUri()) {
throw InvalidArgumentException("binary audio clip file not found"); throw XmlRpcInvalidArgumentException(
"binary audio clip file not found");
} }
// temporary hack; we will expect an absolute file name from getUri() // temporary hack; we will expect an absolute file name from getUri()
@ -1432,7 +1438,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
std::ifstream ifs(binaryFileName.c_str()); std::ifstream ifs(binaryFileName.c_str());
if (!ifs) { if (!ifs) {
ifs.close(); ifs.close();
throw IOException("could not read audio clip"); throw XmlRpcIOException("could not read audio clip");
} }
std::string md5string = Md5(ifs); std::string md5string = Md5(ifs);
ifs.close(); ifs.close();
@ -1495,7 +1501,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
FILE* binaryFile = fopen(binaryFileName.c_str(), "rb"); FILE* binaryFile = fopen(binaryFileName.c_str(), "rb");
if (!binaryFile) { if (!binaryFile) {
throw IOException("Binary audio clip file not found."); throw XmlRpcIOException("Binary audio clip file not found.");
} }
fseek(binaryFile, 0, SEEK_END); fseek(binaryFile, 0, SEEK_END);
long binaryFileSize = ftell(binaryFile); long binaryFileSize = ftell(binaryFile);
@ -1580,7 +1586,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref Ptr<AudioClip>::Ref
WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException) throw (XmlRpcException)
{ {
Ptr<AudioClip>::Ref audioClip = getAudioClip(sessionId, id); Ptr<AudioClip>::Ref audioClip = getAudioClip(sessionId, id);
@ -1646,7 +1652,7 @@ WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const Ptr<AudioClip>::Ref audioClip) const
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1709,7 +1715,7 @@ WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
void void
WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;
@ -1768,7 +1774,7 @@ WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId) WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId)
const const
throw (StorageException) throw (XmlRpcException)
{ {
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClipVector( Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClipVector(
new std::vector<Ptr<AudioClip>::Ref>); new std::vector<Ptr<AudioClip>::Ref>);
@ -1781,7 +1787,7 @@ WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId)
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref
WebStorageClient :: reset(void) WebStorageClient :: reset(void)
throw (StorageException) throw (XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
XmlRpcValue result; XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.15 $ Version : $Revision: 1.16 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -98,8 +98,8 @@ using namespace LiveSupport::Core;
* &lt;!ATTLIST location path CDATA #REQUIRED &gt; * &lt;!ATTLIST location path CDATA #REQUIRED &gt;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: maroy $
* @version $Revision: 1.15 $ * @version $Revision: 1.16 $
*/ */
class WebStorageClient : class WebStorageClient :
virtual public Configurable, virtual public Configurable,
@ -139,16 +139,16 @@ class WebStorageClient :
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @param url pointer in which the URL of the playlist is returned. * @param url pointer in which the URL of the playlist is returned.
* @param token pointer in which the token of the playlist is returned. * @param token pointer in which the token of the playlist is returned.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
void void
editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId, editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id, Ptr<UniqueId>::Ref id,
Ptr<const std::string>::Ref& url, Ptr<const std::string>::Ref& url,
Ptr<const std::string>::Ref& token) const Ptr<const std::string>::Ref& token) const
throw (StorageException); throw (XmlRpcException);
public: public:
/** /**
@ -191,13 +191,13 @@ class WebStorageClient :
* @param id the id of the playlist to check for. * @param id the id of the playlist to check for.
* @return true if a playlist with the specified id exists, * @return true if a playlist with the specified id exists,
* false otherwise. * false otherwise.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual const bool virtual const bool
existsPlaylist(Ptr<SessionId>::Ref sessionId, existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Return a playlist with the specified id, to be displayed. * Return a playlist with the specified id, to be displayed.
@ -205,14 +205,14 @@ class WebStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId, getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -221,28 +221,28 @@ class WebStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return. * @param id the id of the playlist to return.
* @return the requested playlist. * @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId, editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Save the playlist after editing. * Save the playlist after editing.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to save. * @param playlist the playlist to save.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has not been * call or the playlist has not been
* previously opened by getPlaylist() * previously opened by getPlaylist()
*/ */
virtual void virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId, savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -258,14 +258,14 @@ class WebStorageClient :
* @return a new Playlist instance containing a uri field which * @return a new Playlist instance containing a uri field which
* points to an executable (playable) SMIL representation of * points to an executable (playable) SMIL representation of
* the playlist (in the local storage). * the playlist (in the local storage).
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* specified id exists. * specified id exists.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId, acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Release the resources (audio clips, other playlists) used * Release the resources (audio clips, other playlists) used
@ -274,28 +274,28 @@ class WebStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field, * call or the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const Ptr<Playlist>::Ref playlist) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Delete a playlist with the specified id. * Delete a playlist with the specified id.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted. * @param id the id of the playlist to be deleted.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified * call or no playlist with the specified
* id exists. * id exists.
*/ */
virtual void virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId, deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException); throw (XmlRpcException);
/** /**
* Return a list of all playlists in the playlist store. * Return a list of all playlists in the playlist store.
@ -306,24 +306,24 @@ class WebStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return a vector containing the playlists. * @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
getAllPlaylists(Ptr<SessionId>::Ref sessionId) const getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Create a new playlist. * Create a new playlist.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return the newly created playlist. * @return the newly created playlist.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<Playlist>::Ref virtual Ptr<Playlist>::Ref
createPlaylist(Ptr<SessionId>::Ref sessionId) createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException); throw (XmlRpcException);
/** /**
* Tell if an audio clip with a given id exists. * Tell if an audio clip with a given id exists.
@ -332,13 +332,13 @@ class WebStorageClient :
* @param id the id of the audio clip to check for. * @param id the id of the audio clip to check for.
* @return true if an audio clip with the specified id exists, * @return true if an audio clip with the specified id exists,
* false otherwise. * false otherwise.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual const bool virtual const bool
existsAudioClip(Ptr<SessionId>::Ref sessionId, existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Return an audio clip with the specified id. * Return an audio clip with the specified id.
@ -346,14 +346,14 @@ class WebStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return. * @param id the id of the audio clip to return.
* @return the requested audio clip. * @return the requested audio clip.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the * call or no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId, getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Store an audio clip. The <code>uri</code> field of the audio clip * Store an audio clip. The <code>uri</code> field of the audio clip
@ -372,13 +372,13 @@ class WebStorageClient :
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the audio clip to store. * @param audioClip the audio clip to store.
* *
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or we have not logged in yet. * call or we have not logged in yet.
*/ */
virtual void virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException); throw (XmlRpcException);
/** /**
* Acquire the resources for the audio clip with the specified id. * Acquire the resources for the audio clip with the specified id.
@ -390,14 +390,14 @@ class WebStorageClient :
* @param id the id of the audio clip to acquire. * @param id the id of the audio clip to acquire.
* @return a new AudioClip instance, containing a uri field which * @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file. * points to (a way of getting) the sound file.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or if no audio clip with the * call or if no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual Ptr<AudioClip>::Ref virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId, acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const Ptr<UniqueId>::Ref id) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Release the resource (sound file) used by an audio clip. The * Release the resource (sound file) used by an audio clip. The
@ -406,28 +406,28 @@ class WebStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the audio clip has no uri field, * call or the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const Ptr<AudioClip>::Ref audioClip) const
throw (StorageException); throw (XmlRpcException);
/** /**
* Delete an audio clip with the specified id. * Delete an audio clip with the specified id.
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to be deleted. * @param id the id of the audio clip to be deleted.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the * call or no audio clip with the
* specified id exists. * specified id exists.
*/ */
virtual void virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId, deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) Ptr<UniqueId>::Ref id)
throw (StorageException); throw (XmlRpcException);
/** /**
* Return a list of all audio clips in the playlist store. * Return a list of all audio clips in the playlist store.
@ -438,12 +438,12 @@ class WebStorageClient :
* *
* @param sessionId the session ID from the authentication client * @param sessionId the session ID from the authentication client
* @return a vector containing the playlists. * @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call. * call.
*/ */
virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
getAllAudioClips(Ptr<SessionId>::Ref sessionId) const getAllAudioClips(Ptr<SessionId>::Ref sessionId) const
throw (StorageException); throw (XmlRpcException);
/** /**
@ -451,11 +451,11 @@ class WebStorageClient :
* *
* @return a vector containing the UniqueId's of the audio clips * @return a vector containing the UniqueId's of the audio clips
* in the storage after the reset. * in the storage after the reset.
* @exception std::logic_error if the server returns an error. * @exception XmlRpcException if the server returns an error.
*/ */
Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref
reset(void) reset(void)
throw (StorageException); throw (XmlRpcException);
}; };

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.22 $ Version : $Revision: 1.23 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -182,7 +182,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
uniqueIdVector = wsc->reset(); uniqueIdVector = wsc->reset();
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(uniqueIdVector->size() >= 3); CPPUNIT_ASSERT(uniqueIdVector->size() >= 3);
@ -203,7 +203,7 @@ WebStorageClientTest :: playlistTest(void)
try{ try{
playlist = wsc->createPlaylist(sessionId); playlist = wsc->createPlaylist(sessionId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(playlist); CPPUNIT_ASSERT(playlist);
@ -215,7 +215,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
exists = wsc->existsPlaylist(sessionId, playlistIdxx); exists = wsc->existsPlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(exists); CPPUNIT_ASSERT(exists);
@ -224,7 +224,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
exists = wsc->existsPlaylist(sessionId, playlistId77); exists = wsc->existsPlaylist(sessionId, playlistId77);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!exists); CPPUNIT_ASSERT(!exists);
@ -234,7 +234,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
playlist = wsc->editPlaylist(sessionId, playlistIdxx); playlist = wsc->editPlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(playlist); CPPUNIT_ASSERT(playlist);
@ -245,7 +245,7 @@ WebStorageClientTest :: playlistTest(void)
} }
catch (XmlRpcMethodFaultException &e) { catch (XmlRpcMethodFaultException &e) {
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "editPlaylist() threw unexpected exception:\n"; std::string eMsg = "editPlaylist() threw unexpected exception:\n";
CPPUNIT_FAIL(eMsg + e.what()); CPPUNIT_FAIL(eMsg + e.what());
} }
@ -255,7 +255,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
audioClip = wsc->getAudioClip(sessionId, audioClipId); audioClip = wsc->getAudioClip(sessionId, audioClipId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -275,14 +275,14 @@ WebStorageClientTest :: playlistTest(void)
CPPUNIT_ASSERT(throwAwayPlaylist->getPlaylength() CPPUNIT_ASSERT(throwAwayPlaylist->getPlaylength()
->total_seconds() == 0); ->total_seconds() == 0);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
try { try {
wsc->savePlaylist(sessionId, playlist); wsc->savePlaylist(sessionId, playlist);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -292,7 +292,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
newPlaylist = wsc->getPlaylist(sessionId, playlistIdxx); newPlaylist = wsc->getPlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(newPlaylist); CPPUNIT_ASSERT(newPlaylist);
@ -305,7 +305,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
newPlaylist = wsc->acquirePlaylist(sessionId, playlistIdxx); newPlaylist = wsc->acquirePlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(newPlaylist); CPPUNIT_ASSERT(newPlaylist);
@ -331,7 +331,7 @@ WebStorageClientTest :: playlistTest(void)
try { try {
wsc->releasePlaylist(sessionId, newPlaylist); wsc->releasePlaylist(sessionId, newPlaylist);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!newPlaylist->getUri()); CPPUNIT_ASSERT(!newPlaylist->getUri());
@ -341,14 +341,14 @@ WebStorageClientTest :: playlistTest(void)
try { try {
wsc->deletePlaylist(sessionId, playlistIdxx); wsc->deletePlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
try { try {
exists = wsc->existsPlaylist(sessionId, playlistIdxx); exists = wsc->existsPlaylist(sessionId, playlistIdxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!exists); CPPUNIT_ASSERT(!exists);
@ -366,7 +366,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
uniqueIdVector = wsc->reset(); uniqueIdVector = wsc->reset();
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(uniqueIdVector->size() >= 2); CPPUNIT_ASSERT(uniqueIdVector->size() >= 2);
@ -392,7 +392,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
exists = wsc->existsAudioClip(sessionId, id01); exists = wsc->existsAudioClip(sessionId, id01);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(exists); CPPUNIT_ASSERT(exists);
@ -401,21 +401,21 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
audioClip = wsc->getAudioClip(sessionId, id01); audioClip = wsc->getAudioClip(sessionId, id01);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
try { try {
wsc->deleteAudioClip(sessionId, id01); wsc->deleteAudioClip(sessionId, id01);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
try { try {
exists = wsc->existsAudioClip(sessionId, id01); exists = wsc->existsAudioClip(sessionId, id01);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!exists); CPPUNIT_ASSERT(!exists);
@ -424,7 +424,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
exists = wsc->existsAudioClip(sessionId, id77); exists = wsc->existsAudioClip(sessionId, id77);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!exists); CPPUNIT_ASSERT(!exists);
@ -441,7 +441,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
wsc->storeAudioClip(sessionId, audioClip); wsc->storeAudioClip(sessionId, audioClip);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -451,7 +451,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
CPPUNIT_ASSERT( wsc->existsAudioClip(sessionId, idxx)); CPPUNIT_ASSERT( wsc->existsAudioClip(sessionId, idxx));
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -459,7 +459,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
newAudioClip = wsc->getAudioClip(sessionId, idxx); newAudioClip = wsc->getAudioClip(sessionId, idxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -472,7 +472,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
newAudioClip = wsc->acquireAudioClip(sessionId, idxx); newAudioClip = wsc->acquireAudioClip(sessionId, idxx);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(newAudioClip->getUri()); CPPUNIT_ASSERT(newAudioClip->getUri());
@ -482,7 +482,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
wsc->releaseAudioClip(sessionId, newAudioClip); wsc->releaseAudioClip(sessionId, newAudioClip);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(!newAudioClip->getUri()); CPPUNIT_ASSERT(!newAudioClip->getUri());
@ -493,7 +493,7 @@ WebStorageClientTest :: audioClipTest(void)
try { try {
audioClipVector = wsc->getAllAudioClips(sessionId); audioClipVector = wsc->getAllAudioClips(sessionId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
CPPUNIT_ASSERT(audioClipVector->size() == 0); CPPUNIT_ASSERT(audioClipVector->size() == 0);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.12 $ Version : $Revision: 1.13 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -111,7 +111,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try{ try{
sessionId = XmlRpcTools::extractSessionId(parameters); sessionId = XmlRpcTools::extractSessionId(parameters);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+20, XmlRpcTools::markError(errorId+20,
"missing session ID argument", "missing session ID argument",
returnValue); returnValue);
@ -122,7 +122,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try{ try{
playlistId = XmlRpcTools::extractPlaylistId(parameters); playlistId = XmlRpcTools::extractPlaylistId(parameters);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+2, "missing playlist ID argument", XmlRpcTools::markError(errorId+2, "missing playlist ID argument",
returnValue); returnValue);
return; return;
@ -132,7 +132,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try{ try{
audioClipId = XmlRpcTools::extractAudioClipId(parameters); audioClipId = XmlRpcTools::extractAudioClipId(parameters);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+3, "missing audio clip ID argument", XmlRpcTools::markError(errorId+3, "missing audio clip ID argument",
returnValue); returnValue);
return; return;
@ -142,7 +142,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try{ try{
relativeOffset = XmlRpcTools::extractRelativeOffset(parameters); relativeOffset = XmlRpcTools::extractRelativeOffset(parameters);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+4, "missing relative offset argument", XmlRpcTools::markError(errorId+4, "missing relative offset argument",
returnValue); returnValue);
return; return;
@ -157,7 +157,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+5, "playlist not found", XmlRpcTools::markError(errorId+5, "playlist not found",
returnValue); returnValue);
return; return;
@ -174,7 +174,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
audioClip = storage->getAudioClip(sessionId, audioClipId); audioClip = storage->getAudioClip(sessionId, audioClipId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
XmlRpcTools::markError(errorId+7, "audio clip does not exist", XmlRpcTools::markError(errorId+7, "audio clip does not exist",
returnValue); returnValue);
return; return;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -127,7 +127,7 @@ CreatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->createPlaylist(sessionId); playlist = storage->createPlaylist(sessionId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "could not create playlist:\n"; std::string eMsg = "could not create playlist:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools :: markError(errorId+2, XmlRpcTools :: markError(errorId+2,

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -126,7 +126,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);
@ -142,7 +142,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
storage->deletePlaylist(sessionId, playlistId); storage->deletePlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist could not be deleted:\n"; std::string eMsg = "playlist could not be deleted:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+5, eMsg, returnValue); XmlRpcTools::markError(errorId+5, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -137,7 +137,7 @@ DisplayAudioClipMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
audioClip = storage->getAudioClip(sessionId, id); audioClip = storage->getAudioClip(sessionId, id);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "audio clip not found:\n"; std::string eMsg = "audio clip not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.6 $ Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -117,7 +117,7 @@ DisplayAudioClipsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
audioClipVector = storage->getAllAudioClips(sessionId); audioClipVector = storage->getAllAudioClips(sessionId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "getAllAudioClips returned error:\n"; std::string eMsg = "getAllAudioClips returned error:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+2, eMsg, returnValue); XmlRpcTools::markError(errorId+2, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -137,7 +137,7 @@ DisplayPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, id); playlist = storage->getPlaylist(sessionId, id);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -118,7 +118,7 @@ DisplayPlaylistsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlistVector = storage->getAllPlaylists(sessionId); playlistVector = storage->getAllPlaylists(sessionId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "getAllPlaylists() returned error:\n"; std::string eMsg = "getAllPlaylists() returned error:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+2, eMsg, returnValue); XmlRpcTools::markError(errorId+2, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.13 $ Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -138,7 +138,7 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, id); playlist = storage->getPlaylist(sessionId, id);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+4, eMsg, returnValue); XmlRpcTools::markError(errorId+4, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -150,7 +150,7 @@ RemoveAudioClipFromPlaylistMethod :: execute(
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist does not exist:\n"; std::string eMsg = "playlist does not exist:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+4, eMsg, returnValue); XmlRpcTools::markError(errorId+4, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -133,7 +133,7 @@ RevertEditedPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, id); playlist = storage->getPlaylist(sessionId, id);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -133,7 +133,7 @@ SavePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, id); playlist = storage->getPlaylist(sessionId, id);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.6 $ Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -174,7 +174,7 @@ UpdateFadeInFadeOutMethod :: execute(
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist does not exist:\n"; std::string eMsg = "playlist does not exist:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+6, eMsg, returnValue); XmlRpcTools::markError(errorId+6, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.11 $ Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -146,7 +146,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n"; std::string eMsg = "playlist not found:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+4, eMsg, returnValue); XmlRpcTools::markError(errorId+4, eMsg, returnValue);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $ Author : $Author: maroy $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -138,7 +138,7 @@ ValidatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try { try {
playlist = storage->getPlaylist(sessionId, playlistId); playlist = storage->getPlaylist(sessionId, playlistId);
} }
catch (StorageException &e) { catch (XmlRpcException &e) {
std::string eMsg = "playlist does not exist:\n"; std::string eMsg = "playlist does not exist:\n";
eMsg += e.what(); eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue); XmlRpcTools::markError(errorId+3, eMsg, returnValue);