This commit is contained in:
fgerlits 2005-05-27 13:21:54 +00:00
parent 2e7be6308f
commit 4685ab1b5e
10 changed files with 41 additions and 74 deletions

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/include/LiveSupport/Storage/StorageClientInterface.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -66,7 +66,7 @@ using namespace Core;
* An interface for storage clients. * An interface for storage clients.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.14 $ * @version $Revision: 1.15 $
*/ */
class StorageClientInterface class StorageClientInterface
{ {
@ -211,15 +211,13 @@ class StorageClientInterface
* The <code>uri</code> field of the playlist is erased (set to * The <code>uri</code> field of the playlist is erased (set to
* a null pointer). * a null pointer).
* *
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception XmlRpcException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field, * call or the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<Playlist>::Ref playlist) const
Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException) throw (XmlRpcException)
= 0; = 0;
/** /**
@ -332,15 +330,13 @@ class StorageClientInterface
* accessible, and the <code>uri</code> and <code>token</code> fields * accessible, and the <code>uri</code> and <code>token</code> fields
* of the audioClip are erased (set to null pointers). * of the audioClip are erased (set to null pointers).
* *
* @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception XmlRpcException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the audio clip has no uri field, * call or the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException) throw (XmlRpcException)
= 0; = 0;

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.37 $ Version : $Revision: 1.38 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -487,14 +487,9 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
* Release a playlist. * Release a playlist.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId, TestStorageClient :: releasePlaylist(Ptr<Playlist>::Ref playlist) const
Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException) throw (XmlRpcException)
{ {
if (!sessionId) {
throw XmlRpcException("missing session ID argument");
}
if (! playlist->getUri()) { if (! playlist->getUri()) {
throw XmlRpcInvalidArgumentException("playlist URI not found"); throw XmlRpcInvalidArgumentException("playlist URI not found");
} }
@ -514,7 +509,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<PlaylistElement>::Ref plElement = it->second; Ptr<PlaylistElement>::Ref plElement = it->second;
if (plElement->getType() == PlaylistElement::AudioClipType) { if (plElement->getType() == PlaylistElement::AudioClipType) {
try { try {
releaseAudioClip(sessionId, it->second->getAudioClip()); releaseAudioClip(it->second->getAudioClip());
} }
catch (XmlRpcException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
@ -523,7 +518,7 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
++it; ++it;
} else if (plElement->getType() == PlaylistElement::PlaylistType) { } else if (plElement->getType() == PlaylistElement::PlaylistType) {
try { try {
releasePlaylist(sessionId, it->second->getPlaylist()); releasePlaylist(it->second->getPlaylist());
} }
catch (XmlRpcException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
@ -680,14 +675,9 @@ TestStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
* Release an audio clip. * Release an audio clip.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
TestStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId, TestStorageClient :: releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException) throw (XmlRpcException)
{ {
if (!sessionId) {
throw XmlRpcException("missing session ID argument");
}
if (!audioClip->getUri()) { if (!audioClip->getUri()) {
throw XmlRpcException("audio clip does not have a URI field"); throw XmlRpcException("audio clip does not have a URI field");
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.33 $ Version : $Revision: 1.34 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -86,7 +86,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.33 $ * @version $Revision: 1.34 $
*/ */
class TestStorageClient : class TestStorageClient :
virtual public Configurable, virtual public Configurable,
@ -353,14 +353,12 @@ class TestStorageClient :
* The <code>uri</code> field of the playlist is erased (set to * The <code>uri</code> field of the playlist is erased (set to
* a null pointer). * a null pointer).
* *
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception XmlRpcException if the playlist has no uri field, * @exception XmlRpcException if the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<Playlist>::Ref playlist) const
Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException); throw (XmlRpcException);
/** /**
@ -464,14 +462,12 @@ class TestStorageClient :
* accessible, and the <code>uri</code> and <code>token</code> fields * accessible, and the <code>uri</code> and <code>token</code> fields
* of the audioClip are erased (set to null pointers). * of the audioClip are erased (set to null pointers).
* *
* @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception XmlRpcException if the audio clip has no uri field, * @exception XmlRpcException if the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException); throw (XmlRpcException);

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.26 $ Version : $Revision: 1.27 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -343,7 +343,7 @@ TestStorageClientTest :: acquireAudioClipTest(void)
CPPUNIT_ASSERT(*(audioClip->getUri()) == audioClipUri); CPPUNIT_ASSERT(*(audioClip->getUri()) == audioClipUri);
try { try {
tsc->releaseAudioClip(dummySessionId, audioClip); tsc->releaseAudioClip(audioClip);
} catch (XmlRpcException &e) { } catch (XmlRpcException &e) {
std::string eMsg = "could not release audio clip:\n"; std::string eMsg = "could not release audio clip:\n";
eMsg += e.what(); eMsg += e.what();
@ -388,7 +388,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
string savedTempFilePath = playlist->getUri()->substr(7); string savedTempFilePath = playlist->getUri()->substr(7);
try { try {
tsc->releasePlaylist(dummySessionId, playlist); tsc->releasePlaylist(playlist);
} catch (XmlRpcException &e) { } catch (XmlRpcException &e) {
std::string eMsg = "could not release playlist:\n"; std::string eMsg = "could not release playlist:\n";
eMsg += e.what(); eMsg += e.what();

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.40 $ Version : $Revision: 1.41 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -594,11 +594,6 @@ static const std::string acquireAudioClipTokenParamName = "token";
static const std::string releaseAudioClipMethodName static const std::string releaseAudioClipMethodName
= "locstor.releaseRawAudioData"; = "locstor.releaseRawAudioData";
/*------------------------------------------------------------------------------
* The name of the session ID parameter in the input structure
*----------------------------------------------------------------------------*/
static const std::string releaseAudioClipSessionIdParamName = "sessid";
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* The name of the token parameter in the input structure * The name of the token parameter in the input structure
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
@ -1286,8 +1281,7 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
* Release a playlist. * Release a playlist.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId, WebStorageClient :: releasePlaylist(Ptr<Playlist>::Ref playlist) const
Ptr<Playlist>::Ref playlist) const
throw (Core::XmlRpcException) throw (Core::XmlRpcException)
{ {
if (! playlist->getUri()) { if (! playlist->getUri()) {
@ -1309,7 +1303,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
Ptr<PlaylistElement>::Ref plElement = it->second; Ptr<PlaylistElement>::Ref plElement = it->second;
if (plElement->getType() == PlaylistElement::AudioClipType) { if (plElement->getType() == PlaylistElement::AudioClipType) {
try { try {
releaseAudioClip(sessionId, it->second->getAudioClip()); releaseAudioClip(it->second->getAudioClip());
} }
catch (XmlRpcException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
@ -1318,7 +1312,7 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
++it; ++it;
} else if (plElement->getType() == PlaylistElement::PlaylistType) { } else if (plElement->getType() == PlaylistElement::PlaylistType) {
try { try {
releasePlaylist(sessionId, it->second->getPlaylist()); releasePlaylist(it->second->getPlaylist());
} }
catch (XmlRpcException &e) { catch (XmlRpcException &e) {
eMsg += e.what(); eMsg += e.what();
@ -1809,8 +1803,7 @@ WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
* Release an audio clip. * Release an audio clip.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId, WebStorageClient :: releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
Ptr<AudioClip>::Ref audioClip) const
throw (Core::XmlRpcException) throw (Core::XmlRpcException)
{ {
XmlRpcValue parameters; XmlRpcValue parameters;
@ -1820,8 +1813,6 @@ WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
storageServerPath.c_str(), false); storageServerPath.c_str(), false);
parameters.clear(); parameters.clear();
parameters[releaseAudioClipSessionIdParamName]
= sessionId->getId();
parameters[releaseAudioClipTokenParamName] parameters[releaseAudioClipTokenParamName]
= *audioClip->getToken(); = *audioClip->getToken();

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.27 $ Version : $Revision: 1.28 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -96,7 +96,7 @@ using namespace LiveSupport::Core;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.27 $ * @version $Revision: 1.28 $
*/ */
class WebStorageClient : class WebStorageClient :
virtual public Configurable, virtual public Configurable,
@ -346,15 +346,13 @@ class WebStorageClient :
* The <code>uri</code> field of the playlist is erased (set to * The <code>uri</code> field of the playlist is erased (set to
* a null pointer). * a null pointer).
* *
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release. * @param playlist the playlist to release.
* @exception XmlRpcException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the playlist has no uri field, * call or the playlist has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releasePlaylist(Ptr<SessionId>::Ref sessionId, releasePlaylist(Ptr<Playlist>::Ref playlist) const
Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException); throw (XmlRpcException);
/** /**
@ -466,15 +464,13 @@ class WebStorageClient :
* accessible, and the <code>uri</code> and <code>token</code> fields * accessible, and the <code>uri</code> and <code>token</code> fields
* of the audioClip are erased (set to null pointers). * of the audioClip are erased (set to null pointers).
* *
* @param sessionId the session ID from the authentication client
* @param audioClip the id of the audio clip to release. * @param audioClip the id of the audio clip to release.
* @exception XmlRpcException if there is a problem with the XML-RPC * @exception XmlRpcException if there is a problem with the XML-RPC
* call or the audio clip has no uri field, * call or the audio clip has no uri field,
* or the file does not exist, etc. * or the file does not exist, etc.
*/ */
virtual void virtual void
releaseAudioClip(Ptr<SessionId>::Ref sessionId, releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException); throw (XmlRpcException);
/** /**

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.42 $ Version : $Revision: 1.43 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -350,7 +350,7 @@ WebStorageClientTest :: playlistTest(void)
ifs.close(); ifs.close();
try { try {
wsc->releasePlaylist(sessionId, newPlaylist); wsc->releasePlaylist(newPlaylist);
} catch (XmlRpcException &e) { } catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }
@ -488,7 +488,7 @@ WebStorageClientTest :: audioClipTest(void)
// sleep(30); // sleep(30);
try { try {
wsc->releaseAudioClip(sessionId, newAudioClip); wsc->releaseAudioClip(newAudioClip);
} catch (XmlRpcException &e) { } catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what()); CPPUNIT_FAIL(e.what());
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.47 $ Version : $Revision: 1.48 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -425,6 +425,7 @@ LiveSupport :: GLiveSupport ::
GLiveSupport :: logout(void) throw () GLiveSupport :: logout(void) throw ()
{ {
if (sessionId.get() != 0) { if (sessionId.get() != 0) {
stopCueAudio();
storeScratchpadContents(); storeScratchpadContents();
scratchpadContents->clear(); scratchpadContents->clear();
authentication->logout(sessionId); authentication->logout(sessionId);
@ -657,7 +658,7 @@ GLiveSupport :: releaseEditedPlaylist(void)
{ {
if (editedPlaylist.get()) { if (editedPlaylist.get()) {
if (editedPlaylist->isLocked()) { if (editedPlaylist->isLocked()) {
storage->releasePlaylist(sessionId, editedPlaylist); storage->releasePlaylist(editedPlaylist);
} }
editedPlaylist.reset(); editedPlaylist.reset();
} }
@ -871,12 +872,12 @@ GLiveSupport :: releaseOutputAudio(void)
try { try {
switch (outputItemPlayingNow->getType()) { switch (outputItemPlayingNow->getType()) {
case Playable::AudioClipType: case Playable::AudioClipType:
storage->releaseAudioClip(sessionId, storage->releaseAudioClip(
outputItemPlayingNow->getAudioClip()); outputItemPlayingNow->getAudioClip());
outputItemPlayingNow.reset(); outputItemPlayingNow.reset();
break; break;
case Playable::PlaylistType: case Playable::PlaylistType:
storage->releasePlaylist(sessionId, storage->releasePlaylist(
outputItemPlayingNow->getPlaylist()); outputItemPlayingNow->getPlaylist());
outputItemPlayingNow.reset(); outputItemPlayingNow.reset();
break; break;
@ -990,13 +991,11 @@ GLiveSupport :: releaseCueAudio(void)
try { try {
switch (cueItemPlayingNow->getType()) { switch (cueItemPlayingNow->getType()) {
case Playable::AudioClipType: case Playable::AudioClipType:
storage->releaseAudioClip(sessionId, storage->releaseAudioClip(cueItemPlayingNow->getAudioClip());
cueItemPlayingNow->getAudioClip());
cueItemPlayingNow.reset(); cueItemPlayingNow.reset();
break; break;
case Playable::PlaylistType: case Playable::PlaylistType:
storage->releasePlaylist(sessionId, storage->releasePlaylist(cueItemPlayingNow->getPlaylist());
cueItemPlayingNow->getPlaylist());
cueItemPlayingNow.reset(); cueItemPlayingNow.reset();
break; break;
default: // this never happens default: // this never happens

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.11 $ Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -113,7 +113,6 @@ MasterPanelUserInfoWidget :: ~MasterPanelUserInfoWidget (void) throw ()
void void
MasterPanelUserInfoWidget :: onLogoutButtonClicked (void) throw () MasterPanelUserInfoWidget :: onLogoutButtonClicked (void) throw ()
{ {
gLiveSupport->stopCueAudio();
gLiveSupport->logout(); gLiveSupport->logout();
loggedIn = false; loggedIn = false;

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -117,7 +117,7 @@ PlaylistEvent :: deInitialize(void) throw ()
} }
try { try {
storage->releasePlaylist(sessionId, playlist); storage->releasePlaylist(playlist);
} catch (XmlRpcException &e) { } catch (XmlRpcException &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
// TODO: handle error? // TODO: handle error?