changed StorageClientInterface::storeAudioClip() return type to void

This commit is contained in:
fgerlits 2005-01-06 17:25:40 +00:00
parent 4453635885
commit 3d6cb307de
6 changed files with 31 additions and 29 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -65,7 +65,7 @@ using namespace Core;
* An interface for storage clients. * An interface for storage clients.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.2 $ * @version $Revision: 1.3 $
*/ */
class StorageClientInterface class StorageClientInterface
{ {
@ -244,12 +244,11 @@ 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.
* @return true if the operation was successful.
* *
* @exception StorageException if there is a problem with the XML-RPC * @exception StorageException 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 bool virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (StorageException)

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.24 $ Version : $Revision: 1.25 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -489,7 +489,7 @@ TestStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Store an audio clip. * Store an audio clip.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
bool void
TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (StorageException)
@ -499,7 +499,6 @@ TestStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
} }
audioClipMap[audioClip->getId()->getId()] = audioClip; audioClipMap[audioClip->getId()->getId()] = audioClip;
return true;
} }

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.20 $ Version : $Revision: 1.21 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -90,7 +90,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.20 $ * @version $Revision: 1.21 $
*/ */
class TestStorageClient : class TestStorageClient :
virtual public Configurable, virtual public Configurable,
@ -323,11 +323,10 @@ 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.
* @return true if the operation was successful.
* *
* @exception StorageException if we have not logged in yet. * @exception StorageException if we have not logged in yet.
*/ */
virtual bool virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException); throw (StorageException);

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.19 $ Version : $Revision: 1.20 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -464,6 +464,11 @@ static const std::string storeAudioClipAudioClipIdParamName = "gunid";
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
static const std::string storeAudioClipMetadataParamName = "metadata"; static const std::string storeAudioClipMetadataParamName = "metadata";
/*------------------------------------------------------------------------------
* The name of the binary file name parameter in the input structure
*----------------------------------------------------------------------------*/
static const std::string storeAudioClipFileNameParamName = "fname";
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* The name of the checksum of the binary file name in the input structure * The name of the checksum of the binary file name in the input structure
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
@ -1412,7 +1417,7 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Upload an audio clip to the local storage. * Upload an audio clip to the local storage.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
bool void
WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException) throw (StorageException)
@ -1447,6 +1452,8 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
} }
parameters[storeAudioClipMetadataParamName] parameters[storeAudioClipMetadataParamName]
= std::string(*audioClip->getMetadataString()); = std::string(*audioClip->getMetadataString());
parameters[storeAudioClipFileNameParamName]
= std::string(*audioClip->getUri());
parameters[storeAudioClipChecksumParamName] parameters[storeAudioClipChecksumParamName]
= md5string; = md5string;
@ -1564,8 +1571,6 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
result[storeAudioClipAudioClipIdParamName] ))); result[storeAudioClipAudioClipIdParamName] )));
audioClip->setId(newId); audioClip->setId(newId);
} }
return true;
} }

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.14 $ Version : $Revision: 1.15 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -99,7 +99,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.14 $ * @version $Revision: 1.15 $
*/ */
class WebStorageClient : class WebStorageClient :
virtual public Configurable, virtual public Configurable,
@ -371,12 +371,11 @@ 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.
* @return true if the operation was successful.
* *
* @exception StorageException if there is a problem with the XML-RPC * @exception StorageException 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 bool virtual void
storeAudioClip(Ptr<SessionId>::Ref sessionId, storeAudioClip(Ptr<SessionId>::Ref sessionId,
Ptr<AudioClip>::Ref audioClip) Ptr<AudioClip>::Ref audioClip)
throw (StorageException); throw (StorageException);

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.21 $ Version : $Revision: 1.22 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -310,21 +310,22 @@ WebStorageClientTest :: playlistTest(void)
} }
CPPUNIT_ASSERT(newPlaylist); CPPUNIT_ASSERT(newPlaylist);
CPPUNIT_ASSERT(newPlaylist->getUri()); CPPUNIT_ASSERT(newPlaylist->getUri());
//std::cerr << "url:\n" << *newPlaylist->getUri() << "\n"; // std::cerr << "url:\n" << *newPlaylist->getUri() << "\n";
// sleep(30);
std::ifstream ifs(newPlaylist->getUri()->substr(7).c_str()); std::ifstream ifs(newPlaylist->getUri()->substr(7).c_str());
if (!ifs) { // cut off "file://" if (!ifs) { // cut off "file://"
ifs.close(); ifs.close();
CPPUNIT_FAIL("playlist temp file not found"); CPPUNIT_FAIL("playlist temp file not found");
} }
// std::stringstream playlistSmilFile; // std::stringstream playlistSmilFile;
// std::string tempString; // std::string tempString;
// while (ifs) { // while (ifs) {
// std::getline(ifs, tempString); // std::getline(ifs, tempString);
// playlistSmilFile << tempString << "\n"; // playlistSmilFile << tempString << "\n";
// } // }
//std::cerr << "smil:\n" << playlistSmilFile.str() << "\n"; // std::cerr << "smil:\n" << playlistSmilFile.str() << "\n";
//sleep(60); // sleep(60);
ifs.close(); ifs.close();
try { try {