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 $
Version : $Revision: 1.14 $
Version : $Revision: 1.15 $
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.
*
* @author $Author: fgerlits $
* @version $Revision: 1.14 $
* @version $Revision: 1.15 $
*/
class StorageClientInterface
{
@ -211,15 +211,13 @@ class StorageClientInterface
* The <code>uri</code> field of the playlist is erased (set to
* a null pointer).
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release.
* @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
releasePlaylist(Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException)
= 0;
/**
@ -332,15 +330,13 @@ class StorageClientInterface
* accessible, and the <code>uri</code> and <code>token</code> fields
* 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.
* @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
releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException)
= 0;

View file

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

View file

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

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.26 $
Author : $Author: fgerlits $
Version : $Revision: 1.27 $
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);
try {
tsc->releaseAudioClip(dummySessionId, audioClip);
tsc->releaseAudioClip(audioClip);
} catch (XmlRpcException &e) {
std::string eMsg = "could not release audio clip:\n";
eMsg += e.what();
@ -388,7 +388,7 @@ TestStorageClientTest :: acquirePlaylistTest(void)
string savedTempFilePath = playlist->getUri()->substr(7);
try {
tsc->releasePlaylist(dummySessionId, playlist);
tsc->releasePlaylist(playlist);
} catch (XmlRpcException &e) {
std::string eMsg = "could not release playlist:\n";
eMsg += e.what();

View file

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

View file

@ -22,7 +22,7 @@
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 $
------------------------------------------------------------------------------*/
@ -96,7 +96,7 @@ using namespace LiveSupport::Core;
* </code></pre>
*
* @author $Author: fgerlits $
* @version $Revision: 1.27 $
* @version $Revision: 1.28 $
*/
class WebStorageClient :
virtual public Configurable,
@ -346,15 +346,13 @@ class WebStorageClient :
* The <code>uri</code> field of the playlist is erased (set to
* a null pointer).
*
* @param sessionId the session ID from the authentication client
* @param playlist the playlist to release.
* @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
releasePlaylist(Ptr<Playlist>::Ref playlist) const
throw (XmlRpcException);
/**
@ -466,15 +464,13 @@ class WebStorageClient :
* accessible, and the <code>uri</code> and <code>token</code> fields
* 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.
* @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
releaseAudioClip(Ptr<AudioClip>::Ref audioClip) const
throw (XmlRpcException);
/**

View file

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

View file

@ -22,7 +22,7 @@
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 $
------------------------------------------------------------------------------*/
@ -425,6 +425,7 @@ LiveSupport :: GLiveSupport ::
GLiveSupport :: logout(void) throw ()
{
if (sessionId.get() != 0) {
stopCueAudio();
storeScratchpadContents();
scratchpadContents->clear();
authentication->logout(sessionId);
@ -657,7 +658,7 @@ GLiveSupport :: releaseEditedPlaylist(void)
{
if (editedPlaylist.get()) {
if (editedPlaylist->isLocked()) {
storage->releasePlaylist(sessionId, editedPlaylist);
storage->releasePlaylist(editedPlaylist);
}
editedPlaylist.reset();
}
@ -871,12 +872,12 @@ GLiveSupport :: releaseOutputAudio(void)
try {
switch (outputItemPlayingNow->getType()) {
case Playable::AudioClipType:
storage->releaseAudioClip(sessionId,
storage->releaseAudioClip(
outputItemPlayingNow->getAudioClip());
outputItemPlayingNow.reset();
break;
case Playable::PlaylistType:
storage->releasePlaylist(sessionId,
storage->releasePlaylist(
outputItemPlayingNow->getPlaylist());
outputItemPlayingNow.reset();
break;
@ -990,13 +991,11 @@ GLiveSupport :: releaseCueAudio(void)
try {
switch (cueItemPlayingNow->getType()) {
case Playable::AudioClipType:
storage->releaseAudioClip(sessionId,
cueItemPlayingNow->getAudioClip());
storage->releaseAudioClip(cueItemPlayingNow->getAudioClip());
cueItemPlayingNow.reset();
break;
case Playable::PlaylistType:
storage->releasePlaylist(sessionId,
cueItemPlayingNow->getPlaylist());
storage->releasePlaylist(cueItemPlayingNow->getPlaylist());
cueItemPlayingNow.reset();
break;
default: // this never happens

View file

@ -22,7 +22,7 @@
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 $
------------------------------------------------------------------------------*/
@ -113,7 +113,6 @@ MasterPanelUserInfoWidget :: ~MasterPanelUserInfoWidget (void) throw ()
void
MasterPanelUserInfoWidget :: onLogoutButtonClicked (void) throw ()
{
gLiveSupport->stopCueAudio();
gLiveSupport->logout();
loggedIn = false;

View file

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