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
#
#
# Author : $Author: fgerlits $
# Version : $Revision: 1.21 $
# Author : $Author: maroy $
# Version : $Revision: 1.22 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $
#
# @configure_input@
@ -118,7 +118,8 @@ CORE_LIB_OBJS = ${TMP_DIR}/UniqueId.o \
${TMP_DIR}/LocalizedObject.o \
${TMP_DIR}/LocalizedConfigurable.o \
${TMP_DIR}/Md5.o \
${TMP_DIR}/XmlRpcTools.o
${TMP_DIR}/XmlRpcTools.o \
${TMP_DIR}/XmlRpcException.o
TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.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
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
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/Playlist.h"
#include "LiveSupport/Core/SessionId.h"
#include "LiveSupport/Storage/StorageException.h"
#include "LiveSupport/Core/XmlRpcException.h"
namespace LiveSupport {
@ -64,8 +64,8 @@ using namespace Core;
/**
* An interface for storage clients.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
*/
class StorageClientInterface
{
@ -77,13 +77,13 @@ class StorageClientInterface
* @param id the id of the playlist to check for.
* @return true if a playlist with the specified id exists,
* false otherwise.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual const bool
existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -92,14 +92,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -108,14 +108,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -123,14 +123,14 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to save.
* @exception StorageException if there is a problem with the XML-RPC
* call or the playlist has not been
* previously opened by getPlaylist()
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has not been
* previously opened by getPlaylist()
*/
virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -141,14 +141,14 @@ class StorageClientInterface
* @return a new Playlist instance containing a uri field which
* points to an executable (playable) SMIL representation of
* the playlist (in the local storage).
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* specified id exists.
*/
virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -157,28 +157,28 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release.
* @exception StorageException if there is a problem with the XML-RPC
* call or the playlist has no uri field,
* or the file does not exist, etc.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field,
* or the file does not exist, etc.
*/
virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
* Delete a playlist with the specified id.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -186,12 +186,12 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -199,12 +199,12 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @return the newly created playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<Playlist>::Ref
createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -214,13 +214,13 @@ class StorageClientInterface
* @param id the id of the audio clip to check for.
* @return true if an audio clip with the specified id exists,
* false otherwise.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual const bool
existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -229,14 +229,14 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return.
* @return the requested audio clip.
* @exception StorageException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -245,13 +245,13 @@ class StorageClientInterface
* @param sessionId the session ID from the authentication client
* @param audioClip the audio clip to store.
*
* @exception StorageException if there is a problem with the XML-RPC
* call or we have not logged in yet.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or we have not logged in yet.
*/
virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip)
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -261,14 +261,14 @@ class StorageClientInterface
* @param id the id of the audio clip to acquire.
* @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file.
* @exception StorageException if there is a problem with the XML-RPC
* call or if no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or if no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -276,14 +276,14 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release.
* @exception StorageException if there is a problem with the XML-RPC
* call or the audio clip has no uri field,
* or the file does not exist, etc.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or the audio clip has no uri field,
* or the file does not exist, etc.
*/
virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -291,14 +291,14 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to be deleted.
* @exception StorageException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
*/
virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
= 0;
/**
@ -306,12 +306,12 @@ class StorageClientInterface
*
* @param sessionId the session ID from the authentication client
* @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
getAllAudioClips(Ptr<SessionId>::Ref sessionId) const
throw (StorageException)
throw (XmlRpcException)
= 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
Author : $Author: fgerlits $
Version : $Revision: 1.2 $
Author : $Author: maroy $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/StorageClientFactoryTest.cxx,v $
------------------------------------------------------------------------------*/
@ -152,7 +152,7 @@ StorageClientFactoryTest :: firstTest(void)
try {
CPPUNIT_ASSERT( storage->existsPlaylist(sessionId, id01));
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "existsPlaylist returned error:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -161,7 +161,7 @@ StorageClientFactoryTest :: firstTest(void)
try {
CPPUNIT_ASSERT(!storage->existsPlaylist(sessionId, id77));
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "existsPlaylist returned error:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -171,7 +171,7 @@ StorageClientFactoryTest :: firstTest(void)
Ptr<Playlist>::Ref playlist = storage->getPlaylist(sessionId, id01);
CPPUNIT_ASSERT(playlist->getId()->getId() == id01->getId());
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "getPlaylist returned error:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.25 $
Author : $Author: maroy $
Version : $Revision: 1.26 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -42,6 +42,8 @@
#include <fstream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "LiveSupport/Core/XmlRpcInvalidArgumentException.h"
#include "LiveSupport/Core/XmlRpcIOException.h"
#include "TestStorageClient.h"
using namespace boost::posix_time;
@ -205,12 +207,12 @@ TestStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
PlaylistMap::const_iterator it = playlistMap.find(id->getId());
if (it == playlistMap.end()) {
throw StorageException("no such playlist");
throw XmlRpcException("no such playlist");
}
return it->second;
@ -223,12 +225,12 @@ TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
PlaylistMap::const_iterator it = playlistMap.find(id->getId());
if (it == playlistMap.end()) {
throw StorageException("no such playlist");
throw XmlRpcException("no such playlist");
}
return it->second;
@ -252,12 +254,12 @@ TestStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
PlaylistMap::const_iterator playlistMapIt = playlistMap.find(id->getId());
if (playlistMapIt == playlistMap.end()) {
throw Storage::InvalidArgumentException("no such playlist");
throw XmlRpcInvalidArgumentException("no such playlist");
}
Ptr<Playlist>::Ref oldPlaylist = playlistMapIt->second;
@ -317,7 +319,7 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
++it;
}
else { // this should never happen
throw Storage::InvalidArgumentException(
throw XmlRpcInvalidArgumentException(
"unexpected playlist element type "
"(neither audio clip nor playlist)");
}
@ -342,16 +344,16 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
void
TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException)
throw (XmlRpcException)
{
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());
if (!ifs) { // cut of "file://"
ifs.close();
throw Storage::IOException("playlist temp file not found");
throw XmlRpcIOException("playlist temp file not found");
}
ifs.close();
@ -365,7 +367,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try {
releaseAudioClip(sessionId, it->second->getAudioClip());
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
eMsg += e.what();
eMsg += "\n";
}
@ -375,7 +377,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try {
releasePlaylist(sessionId, it->second->getPlaylist());
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
eMsg += e.what();
eMsg += "\n";
}
@ -391,7 +393,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
if (eMsg != "") {
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
TestStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
{
// erase() returns the number of entries found & erased
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
TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
AudioClipMap::const_iterator it = audioClipMap.find(id->getId());
if (it == audioClipMap.end()) {
throw StorageException("no such audio clip");
throw XmlRpcException("no such audio clip");
}
return it->second;
@ -492,7 +494,7 @@ TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
void
TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip)
throw (StorageException)
throw (XmlRpcException)
{
if (!audioClip->getId()) {
audioClip->setId(UniqueId::generateId());
@ -508,18 +510,18 @@ TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref
TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
AudioClipMap::const_iterator it = audioClipMap.find(id->getId());
if (it == audioClipMap.end()) {
throw StorageException("no such audio clip");
throw XmlRpcException("no such audio clip");
}
Ptr<AudioClip>::Ref storedAudioClip = it->second;
if (! storedAudioClip->getUri()) {
throw StorageException("audio clip URI not found");
throw XmlRpcException("audio clip URI not found");
}
// cut the "file:" off
std::string audioClipFileName = storedAudioClip->getUri()->substr(5);
@ -527,7 +529,7 @@ TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
std::ifstream ifs(audioClipFileName.c_str());
if (!ifs) {
ifs.close();
throw StorageException("could not read audio clip");
throw XmlRpcException("could not read audio clip");
}
ifs.close();
@ -549,10 +551,10 @@ TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
void
TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const
throw (StorageException)
throw (XmlRpcException)
{
if (*(audioClip->getUri()) == "") {
throw StorageException("audio clip URI not found");
throw XmlRpcException("audio clip URI not found");
}
Ptr<std::string>::Ref nullPointer;
@ -566,11 +568,11 @@ TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
void
TestStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
{
// erase() returns the number of entries found & erased
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
Author : $Author: fgerlits $
Version : $Revision: 1.21 $
Author : $Author: maroy $
Version : $Revision: 1.22 $
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;
* </code></pre>
*
* @author $Author: fgerlits $
* @version $Revision: 1.21 $
* @author $Author: maroy $
* @version $Revision: 1.22 $
*/
class TestStorageClient :
virtual public Configurable,
@ -183,13 +183,13 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if no playlist with the specified
* id exists.
* @exception XmlRpcException if no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId,
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 id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if no playlist with the specified
* id exists.
* @exception XmlRpcException if no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
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
* points to an executable (playable) SMIL representation of
* the playlist (in the local storage).
* @exception StorageException if no playlist with the specified
* specified id exists.
* @exception XmlRpcException if no playlist with the specified
* specified id exists.
*/
virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId,
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 playlist the playlist to release.
* @exception StorageException if the playlist has no uri field,
* or the file does not exist, etc.
* @exception XmlRpcException if the playlist has no uri field,
* or the file does not exist, etc.
*/
virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException);
throw (XmlRpcException);
/**
* Delete a playlist with the specified id.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted.
* @exception StorageException if no playlist with the specified
* id exists.
* @exception XmlRpcException if no playlist with the specified
* id exists.
*/
virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException);
throw (XmlRpcException);
/**
@ -310,13 +310,13 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return.
* @return the requested audio clip.
* @exception StorageException if no audio clip with the
* specified id exists.
* @exception XmlRpcException if no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* Store an audio clip.
@ -324,12 +324,12 @@ class TestStorageClient :
* @param sessionId the session ID from the authentication client
* @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
storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip)
throw (StorageException);
throw (XmlRpcException);
/**
* 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.
* @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file.
* @exception StorageException if no audio clip with the
* specified id exists.
* @exception XmlRpcException if no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId,
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 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.
*/
virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId,
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 id the id of the audio clip to be deleted.
* @exception StorageException if no audio clip with the
* specified id exists.
* @exception XmlRpcException if no audio clip with the
* specified id exists.
*/
virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId,
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
Author : $Author: fgerlits $
Version : $Revision: 1.19 $
Author : $Author: maroy $
Version : $Revision: 1.20 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/
@ -135,17 +135,17 @@ TestStorageClientTest :: deletePlaylistTest(void)
try {
tsc->deletePlaylist(dummySessionId, id2);
CPPUNIT_FAIL("allowed to delete non-existent playlist");
} catch (StorageException &e) {
} catch (XmlRpcException &e) {
}
try {
tsc->deletePlaylist(dummySessionId, id1);
} catch (StorageException &e) {
} catch (XmlRpcException &e) {
CPPUNIT_FAIL("cannot delete existing playlist");
}
try {
tsc->deletePlaylist(dummySessionId, id1);
CPPUNIT_FAIL("allowed to delete non-existent playlist");
} catch (StorageException &e) {
} catch (XmlRpcException &e) {
}
}
@ -235,7 +235,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
try {
audioClip = tsc->acquireAudioClip(dummySessionId, id2);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "could not acquire audio clip:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -248,7 +248,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
try {
tsc->releaseAudioClip(dummySessionId, audioClip);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "could not release audio clip:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -258,7 +258,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
audioClip = tsc->acquireAudioClip(dummySessionId, id77);
CPPUNIT_FAIL("allowed to acquire non-existent audio clip");
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
}
}
@ -277,7 +277,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
try {
playlist = tsc->acquirePlaylist(dummySessionId, id1);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "could not acquire playlist:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -296,7 +296,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
try {
tsc->releasePlaylist(dummySessionId, playlist);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "could not release playlist:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
@ -313,6 +313,6 @@ TestStorageClientTest :: acquirePlaylistTest(void)
playlist = tsc->acquirePlaylist(dummySessionId, id77);
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
Author : $Author: fgerlits $
Version : $Revision: 1.20 $
Author : $Author: maroy $
Version : $Revision: 1.21 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,11 @@
#include <curl/easy.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"
using namespace boost::posix_time;
@ -645,7 +650,7 @@ WebStorageClient :: configure(const xmlpp::Element & element)
const bool
WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -698,7 +703,7 @@ WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -810,7 +815,7 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
Ptr<Playlist>::Ref playlist(new Playlist(id));
Ptr<const std::string>::Ref url, token;
@ -844,7 +849,7 @@ WebStorageClient :: editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id,
Ptr<const std::string>::Ref& url,
Ptr<const std::string>::Ref& token) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -901,10 +906,10 @@ WebStorageClient :: editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
void
WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException)
throw (XmlRpcException)
{
if (!playlist || !playlist->getToken()) {
throw InvalidArgumentException("playlist has no token field");
throw XmlRpcInvalidArgumentException("playlist has no token field");
}
XmlRpcValue parameters;
@ -969,7 +974,7 @@ WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref
WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
Ptr<Playlist>::Ref oldPlaylist = getPlaylist(sessionId, id);
@ -1029,7 +1034,7 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
++it;
}
else { // this should never happen
throw Storage::InvalidArgumentException(
throw XmlRpcInvalidArgumentException(
"unexpected playlist element type "
"(neither audio clip nor playlist)");
}
@ -1053,16 +1058,16 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
void
WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException)
throw (XmlRpcException)
{
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());
if (!ifs) { // cut of "file://"
ifs.close();
throw Storage::IOException("playlist temp file not found");
throw XmlRpcIOException("playlist temp file not found");
}
ifs.close();
@ -1076,7 +1081,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try {
releaseAudioClip(sessionId, it->second->getAudioClip());
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
eMsg += e.what();
eMsg += "\n";
}
@ -1086,7 +1091,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
try {
releasePlaylist(sessionId, it->second->getPlaylist());
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
eMsg += e.what();
eMsg += "\n";
}
@ -1102,7 +1107,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
if (eMsg != "") {
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
WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1171,7 +1176,7 @@ WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException)
throw (XmlRpcException)
{
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref playlistVector(
new std::vector<Ptr<Playlist>::Ref>);
@ -1184,7 +1189,7 @@ WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
*----------------------------------------------------------------------------*/
Ptr<Playlist>::Ref
WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1253,7 +1258,7 @@ WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
const bool
WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1306,7 +1311,7 @@ WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref
WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1420,10 +1425,11 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
void
WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip)
throw (StorageException)
throw (XmlRpcException)
{
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()
@ -1432,7 +1438,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
std::ifstream ifs(binaryFileName.c_str());
if (!ifs) {
ifs.close();
throw IOException("could not read audio clip");
throw XmlRpcIOException("could not read audio clip");
}
std::string md5string = Md5(ifs);
ifs.close();
@ -1495,7 +1501,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
FILE* binaryFile = fopen(binaryFileName.c_str(), "rb");
if (!binaryFile) {
throw IOException("Binary audio clip file not found.");
throw XmlRpcIOException("Binary audio clip file not found.");
}
fseek(binaryFile, 0, SEEK_END);
long binaryFileSize = ftell(binaryFile);
@ -1580,7 +1586,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref
WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException)
throw (XmlRpcException)
{
Ptr<AudioClip>::Ref audioClip = getAudioClip(sessionId, id);
@ -1646,7 +1652,7 @@ WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
void
WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1709,7 +1715,7 @@ WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
void
WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;
@ -1768,7 +1774,7 @@ WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId)
const
throw (StorageException)
throw (XmlRpcException)
{
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClipVector(
new std::vector<Ptr<AudioClip>::Ref>);
@ -1781,7 +1787,7 @@ WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId)
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref
WebStorageClient :: reset(void)
throw (StorageException)
throw (XmlRpcException)
{
XmlRpcValue parameters;
XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.15 $
Author : $Author: maroy $
Version : $Revision: 1.16 $
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;
* </code></pre>
*
* @author $Author: fgerlits $
* @version $Revision: 1.15 $
* @author $Author: maroy $
* @version $Revision: 1.16 $
*/
class WebStorageClient :
virtual public Configurable,
@ -139,16 +139,16 @@ class WebStorageClient :
* @param id the id of the playlist to return.
* @param url pointer in which the URL 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
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
void
editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id,
Ptr<const std::string>::Ref& url,
Ptr<const std::string>::Ref& token) const
throw (StorageException);
throw (XmlRpcException);
public:
/**
@ -191,13 +191,13 @@ class WebStorageClient :
* @param id the id of the playlist to check for.
* @return true if a playlist with the specified id exists,
* false otherwise.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual const bool
existsPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* 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 id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
getPlaylist(Ptr<SessionId>::Ref sessionId,
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 id the id of the playlist to return.
* @return the requested playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual Ptr<Playlist>::Ref
editPlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* Save the playlist after editing.
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to save.
* @exception StorageException if there is a problem with the XML-RPC
* call or the playlist has not been
* previously opened by getPlaylist()
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has not been
* previously opened by getPlaylist()
*/
virtual void
savePlaylist(Ptr<SessionId>::Ref sessionId,
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
* points to an executable (playable) SMIL representation of
* the playlist (in the local storage).
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* specified id exists.
*/
virtual Ptr<Playlist>::Ref
acquirePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* Release the resources (audio clips, other playlists) used
@ -274,28 +274,28 @@ class WebStorageClient :
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release.
* @exception StorageException if there is a problem with the XML-RPC
* call or the playlist has no uri field,
* or the file does not exist, etc.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field,
* or the file does not exist, etc.
*/
virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<Playlist>::Ref playlist) const
throw (StorageException);
throw (XmlRpcException);
/**
* Delete a playlist with the specified id.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the playlist to be deleted.
* @exception StorageException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no playlist with the specified
* id exists.
*/
virtual void
deletePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException);
throw (XmlRpcException);
/**
* 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
* @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (StorageException);
throw (XmlRpcException);
/**
* Create a new playlist.
*
* @param sessionId the session ID from the authentication client
* @return the newly created playlist.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<Playlist>::Ref
createPlaylist(Ptr<SessionId>::Ref sessionId)
throw (StorageException);
throw (XmlRpcException);
/**
* 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.
* @return true if an audio clip with the specified id exists,
* false otherwise.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual const bool
existsAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* Return an audio clip with the specified id.
@ -346,14 +346,14 @@ class WebStorageClient :
* @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to return.
* @return the requested audio clip.
* @exception StorageException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
getAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* 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 audioClip the audio clip to store.
*
* @exception StorageException if there is a problem with the XML-RPC
* call or we have not logged in yet.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or we have not logged in yet.
*/
virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip)
throw (StorageException);
throw (XmlRpcException);
/**
* 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.
* @return a new AudioClip instance, containing a uri field which
* points to (a way of getting) the sound file.
* @exception StorageException if there is a problem with the XML-RPC
* call or if no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or if no audio clip with the
* specified id exists.
*/
virtual Ptr<AudioClip>::Ref
acquireAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id) const
throw (StorageException);
throw (XmlRpcException);
/**
* 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 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,
* or the file does not exist, etc.
*/
virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) const
throw (StorageException);
throw (XmlRpcException);
/**
* Delete an audio clip with the specified id.
*
* @param sessionId the session ID from the authentication client
* @param id the id of the audio clip to be deleted.
* @exception StorageException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call or no audio clip with the
* specified id exists.
*/
virtual void
deleteAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<UniqueId>::Ref id)
throw (StorageException);
throw (XmlRpcException);
/**
* 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
* @return a vector containing the playlists.
* @exception StorageException if there is a problem with the XML-RPC
* call.
* @exception XmlRpcException if there is a problem with the XML-RPC
* call.
*/
virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
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
* 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
reset(void)
throw (StorageException);
throw (XmlRpcException);
};

View File

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

View File

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

View File

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

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.9 $
Author : $Author: maroy $
Version : $Revision: 1.10 $
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 {
playlist = storage->getPlaylist(sessionId, playlistId);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "playlist not found:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+3, eMsg, returnValue);
@ -142,7 +142,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
try {
storage->deletePlaylist(sessionId, playlistId);
}
catch (StorageException &e) {
catch (XmlRpcException &e) {
std::string eMsg = "playlist could not be deleted:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+5, eMsg, returnValue);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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