modified the authentication and storage modules to throw their
own exception classes AuthenticationException and StorageException instead of invalid_argument and logic_error
This commit is contained in:
parent
adf05eaf29
commit
de2b5a49a2
61 changed files with 1121 additions and 539 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.19 $
|
||||
Version : $Revision: 1.20 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -90,7 +90,7 @@ using namespace LiveSupport::Core;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.19 $
|
||||
* @version $Revision: 1.20 $
|
||||
*/
|
||||
class TestStorageClient :
|
||||
virtual public Configurable,
|
||||
|
@ -157,14 +157,12 @@ class TestStorageClient :
|
|||
* @param element the XML element to configure the object from.
|
||||
* @exception std::invalid_argument if the supplied XML element
|
||||
* contains bad configuraiton information
|
||||
* @exception std::logic_error if the scheduler daemon has already
|
||||
* been configured, and can not be reconfigured.
|
||||
*/
|
||||
virtual void
|
||||
configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument,
|
||||
std::logic_error);
|
||||
|
||||
throw (std::invalid_argument);
|
||||
|
||||
|
||||
/**
|
||||
* Tell if a playlist with a given id exists.
|
||||
*
|
||||
|
@ -174,9 +172,10 @@ class TestStorageClient :
|
|||
* false otherwise.
|
||||
*/
|
||||
virtual const bool
|
||||
existsPlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw ();
|
||||
existsPlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw ();
|
||||
|
||||
|
||||
/**
|
||||
* Return a playlist with the specified id, to be displayed.
|
||||
|
@ -184,13 +183,14 @@ 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 std::invalid_argument if no playlist with the specified
|
||||
* id exists.
|
||||
* @exception StorageException if no playlist with the specified
|
||||
* id exists.
|
||||
*/
|
||||
virtual Ptr<Playlist>::Ref
|
||||
getPlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (std::invalid_argument);
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Return a playlist with the specified id, to be edited.
|
||||
|
@ -198,26 +198,26 @@ 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 std::invalid_argument if no playlist with the specified
|
||||
* id exists.
|
||||
* @exception StorageException if no playlist with the specified
|
||||
* id exists.
|
||||
*/
|
||||
virtual Ptr<Playlist>::Ref
|
||||
editPlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (std::invalid_argument);
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Save the playlist after editing.
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param playlist the playlist to save.
|
||||
* @exception std::logic_error if the playlist has not been previously
|
||||
* opened by getPlaylist()
|
||||
*/
|
||||
virtual void
|
||||
savePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<Playlist>::Ref playlist) const
|
||||
throw (std::logic_error);
|
||||
throw ();
|
||||
|
||||
|
||||
/**
|
||||
* Acquire the resources for the playlist.
|
||||
|
@ -232,13 +232,14 @@ 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 std::invalid_argument if no playlist with the specified
|
||||
* specified id exists.
|
||||
* @exception StorageException if no playlist with the specified
|
||||
* specified id exists.
|
||||
*/
|
||||
virtual Ptr<Playlist>::Ref
|
||||
acquirePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (std::logic_error);
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Release the resources (audio clips, other playlists) used
|
||||
|
@ -246,26 +247,27 @@ class TestStorageClient :
|
|||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param playlist the playlist to release.
|
||||
* @exception std::logic_error if the playlist has no uri field,
|
||||
* or the file does not exist, etc.
|
||||
* @exception StorageException 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 (std::logic_error);
|
||||
releasePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<Playlist>::Ref playlist) const
|
||||
throw (StorageException);
|
||||
|
||||
/**
|
||||
* Delete the playlist with the specified id.
|
||||
* 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 std::invalid_argument if no playlist with the specified
|
||||
* id exists.
|
||||
* @exception StorageException if no playlist with the specified
|
||||
* id exists.
|
||||
*/
|
||||
virtual void
|
||||
deletePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id)
|
||||
throw (std::invalid_argument);
|
||||
deletePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id)
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of all playlists in the playlist store.
|
||||
|
@ -275,7 +277,8 @@ class TestStorageClient :
|
|||
*/
|
||||
virtual Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
|
||||
getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
|
||||
throw ();
|
||||
throw ();
|
||||
|
||||
|
||||
/**
|
||||
* Create a new playlist.
|
||||
|
@ -285,7 +288,8 @@ class TestStorageClient :
|
|||
*/
|
||||
virtual Ptr<Playlist>::Ref
|
||||
createPlaylist(Ptr<SessionId>::Ref sessionId)
|
||||
throw ();
|
||||
throw ();
|
||||
|
||||
|
||||
/**
|
||||
* Tell if an audio clip with a given id exists.
|
||||
|
@ -298,7 +302,7 @@ class TestStorageClient :
|
|||
virtual const bool
|
||||
existsAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw ();
|
||||
throw ();
|
||||
|
||||
/**
|
||||
* Return an audio clip with the specified id.
|
||||
|
@ -306,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 std::invalid_argument if no audio clip with the
|
||||
* specified id exists.
|
||||
* @exception StorageException if no audio clip with the
|
||||
* specified id exists.
|
||||
*/
|
||||
virtual Ptr<AudioClip>::Ref
|
||||
getAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (std::invalid_argument);
|
||||
getAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (StorageException);
|
||||
|
||||
/**
|
||||
* Store an audio clip.
|
||||
|
@ -320,12 +324,13 @@ class TestStorageClient :
|
|||
* @param sessionId the session ID from the authentication client
|
||||
* @param audioClip the audio clip to store.
|
||||
* @return true if the operation was successful.
|
||||
* @exception std::invalid_argument never in this implementation
|
||||
*
|
||||
* @exception StorageException if we have not logged in yet.
|
||||
*/
|
||||
virtual bool
|
||||
storeAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<AudioClip>::Ref audioClip)
|
||||
throw (std::invalid_argument);
|
||||
throw (StorageException);
|
||||
|
||||
/**
|
||||
* Acquire the resources for the audio clip with the specified id.
|
||||
|
@ -339,50 +344,52 @@ 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 std::invalid_argument if no audio clip with the
|
||||
* specified id exists.
|
||||
* @exception StorageException if no audio clip with the
|
||||
* specified id exists.
|
||||
*/
|
||||
virtual Ptr<AudioClip>::Ref
|
||||
acquireAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (std::logic_error);
|
||||
acquireAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id) const
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Release the resource (sound file) used by an audio clip.
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param audioClip the audio clip to release.
|
||||
* @exception std::logic_error if the audio clip has no uri field,
|
||||
* or the file does not exist, etc.
|
||||
* @param audioClip the id of the audio clip to release.
|
||||
* @exception StorageException 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 (std::logic_error);
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Delete the audio clip with the specified id.
|
||||
* 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 std::invalid_argument if no audio clip with the
|
||||
* specified id exists.
|
||||
* @exception StorageException if no audio clip with the
|
||||
* specified id exists.
|
||||
*/
|
||||
virtual void
|
||||
deleteAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id)
|
||||
throw (std::invalid_argument);
|
||||
deleteAudioClip(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<UniqueId>::Ref id)
|
||||
throw (StorageException);
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of all audio clips in the playlist store.
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @return a vector containing the audio clips.
|
||||
* @return a vector containing the playlists.
|
||||
*/
|
||||
virtual Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
|
||||
getAllAudioClips(Ptr<SessionId>::Ref sessionId) const
|
||||
throw ();
|
||||
|
||||
throw ();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue