diff --git a/livesupport/doc/model/Scheduler/index.html b/livesupport/doc/model/Scheduler/index.html index b19fa7456..9770f83d5 100644 --- a/livesupport/doc/model/Scheduler/index.html +++ b/livesupport/doc/model/Scheduler/index.html @@ -1,5785 +1,4212 @@ - - - - - LiveSupport Scheduler specifications - - - - - - -

Preface

-

This document is part of the LiveSupport -project, Copyright Š 2004 Media -Development Loan Fund, under the GNU GPL.

- -

Scope

-

This document contains the specification of the LiveSupport -Scheduler daemon.

This document contains embedded SVG -figures, thus an SVG capable browser is needed to view it, or an SVG -plugin like Adobe's SVG Viewer.

-

Requirements

-

Overview

-

The purpose of the LiveSupport Scheduler daemon is to execute -playlists.

-

Goals

-

The scheduler daemon is a remotely accessible service accepting -playlists on a local audio interface. Specific goals include:

- -

System functions

-

The main system functions are described -below. There are three categories for these functions:

- - - - - - - - - - - - - - - - - -
-

function category

-
-

meaning

-
-

evident

-
-

Should perform, and the user should be cognizant that it is - performed

-
-

hidden

-
-

Should perform, but not visible to the users.

-
-

frill

-
-

Optional

-
-



-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref#

-
-

function

-
-

category

-
-

F1.1

-
-

Accept uploaded playlists

-
-

evident

-
-

F1.2

-
-

Retrieve remote files referenced by playlists

-
-

hidden

-
-

F1.3

-
-

Access local files

-
-

hidden

-
-

F1.4

-
-

Provide status information

-
-

evident

-
-

F1.5

-
-

Log playlist execution for proof of broadcast reasons

-
-

evident

-
-

F1.6

-
-

Purge local file storage of unused audio clips

-
-

hidden

-
-

F1.7

-
-

Execute playlists

-
-

evident

-
-

F1.8

-
-

Play live streams as part of the playlist

-
-

hidden

-
-

F1.9

-
-

Remove playists from the schedule

-
-

evident

-
-

F1.10

-
-

Re-schedule playlsits

-
-

evident

-
-

F1.11

-
-

Delete playlists

-
-

evident

-
-

F1.12

-
-

Create playlists

-
-

evident

-
-

F1.13

-
-

Edit playlists

-
-

evident

-
-

F1.14

-
-

Start the scheduler daemon

-
-

evident

-
-

F1.15

-
-

Stop the scheduler daemon

-
-

evident

-
-


-

-
-


-

-
-


-

-
-



-

-

System attributes

-

Generic attributes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref#

-
-

attribute

-
-

details and constraints

-
-

category

-
-

A1.1

-
-

operating system platform

-
-

Linux

-
-

must

-
-

A1.2

-
-

supported audio interfaces

-
-

ALSA (maybe also OSS?)

-
-

must

-
-

A1.3

-
-

supported playlist format

-
-

SMIL 2.0. only partial support is required, which focuses only - on audio aspects of SMIL.

-
-

must

-
-

A1.4

-
-

supported audio clip formats

-
-

Ogg Vorbis, mp3, wav

-
-

must

-
-


-

-
-


-

-
-


-

-
-


-

-
-


Attributes related to system functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref#

-
-

function

-
-

ref#

-
-

attribute

-
-

details and constraints

-
-

category

-
-

F1.7

-
-

Execute playlists

-
-

A1.5

-
-

low latency

-
-

when executing playlists, very low latency should be achieved

-
-

must

-
-


-

-
-


-

-
-

A1.6

-
-

handle time skew

-
-

the daemon has to take into account that the system's clock is - not accurate. the clock is synchronized to an external regularly, - but the resulting time-jump must be handled.

-
-

must

-
-

F1.8

-
-

Play live streams as part of the playlist -

-
-

A1.7

-
-

supported audio stream formats

-
-

Ogg Vorbis via HTTP, mp3 via HTTP

-
-

must

-
-

F1.14
F1.15

-
-

Start / stop the scheduler daemon

-
-

A1.8

-
-

provide System V init style services

-
-

Provide a System V init interface to starting and stopping the - scheduler daemon

-
-

must

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Essential use cases

-

This section lists generic (essential) uses cases, that do not -contain architecture-specific considerations.

-

UC-1 Upload playlist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-1 -

-
-

use case -

-
-

Upload playlist -

-
-

type -

-
-

primary, essential -

-
-

actors -

-
-

Playlist editor -

-
-

purpose -

-
-

Upload a playlist -

-
-

overview -

-
-

The Playlist editor uploads a new playlist. -

-
-

references -

-
-

F1.1 -

-
-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Playlist editor connects to the scheduler daemon with the - intent of uploading a new playlist. -

-
-


-

-
-


-

-
-

2. -

-
-

The Playlist editor provides authentication information -

-
-

3. -

-
-

The system authenticates the Playlist editor and grants access. -

-
-

4. -

-
-

The Playlist editor presents the new playlist and the intended - schedule for the playlist.

-
-

5. -

-
-

The system validates the new playlist, and sees that it does - not conflict with existing schedule. -

-
-


-

-
-


-

-
-

6. -

-
-

The system stores the new playlist, adds it to the schedule, - and sends confirmation to the Playlist editor. -

-
-

7. -

-
-

The Playlist editor receives confirmation and disconnects. -

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -

UC-2 Manage schedule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref#

-
-

UC-2 -

-
-

use case -

-
-

Manage schedule -

-
-

type

-
-

primary, essential -

-
-

actors

-
-

Playlist editor -

-
-

purpose

-
-

View the schedule and remove or re-schedule playlists

-
-

overview

-
-

The Playlist editor reviews the schedule. If he decides to, he - might remove or re-schedule some of these playlists. -

-
-

references

-
-

F1.4, F1.9, F1.10

-
-



-

-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Playlist editor connects to the scheduler daemon with the - intent of viewing and editing the schedule.

-
-


-

-
-


-

-
-

2. -

-
-

The Playlist editor provides authentication information -

-
-

3. -

-
-

The system authenticates the Playlist editor and grants access. -

-
-


-

-
-


-

-
-

4.

-
-

The system shows the Schedule to the Playlist editor

-
-

5.

-
-

The Playlist editor browses the Schedule, selects a playlist - for detailed viewing.

-
-

6.

-
-

The system shows the details of the selected Playlist.

-
-

7.

-
-

The playlist editor removes a playlist from the schedule.

-
-

8.

-
-

The system removes the playlist from the schedule, than - re-displays the updated schedle.

-
-

9.

-
-

The Playlist editor re-schedules a playlist

-
-

10.

-
-

The system removes the selected playlist from the schedule, and - re-enters it at a new timepoint

-
-

11.

-
-

The Playlist editor browses the Schedule

-
-

12.

-
-

The system shows the Schedule to the playlist editor

-
-

13.

-
-

The Playlist editor disconnects.

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -

UC-3 Manage playlists

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref#

-
-

UC-3 -

-
-

use case -

-
-

Manage playlists -

-
-

type

-
-

primary, essential -

-
-

actors

-
-

Playlist editor -

-
-

purpose

-
-

View and delete playlists -

-
-

overview

-
-

The Playlist editor reviews the uploaded playlists. If he - decides so, he might delete some of these playlists. -

-
-

references

-
-

F1.4, F1.11

-
-



-

-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Playlist editor connects to the scheduler daemon with the - intent of viewing and deleting playlists.

-
-


-

-
-


-

-
-

2. -

-
-

The Playlist editor provides authentication information -

-
-

3. -

-
-

The system authenticates the Playlist editor and grants access. -

-
-


-

-
-


-

-
-

4.

-
-

The system lists the available Playlists

-
-

5.

-
-

The Playlist editor browses the playlists, and selects one for - detailed viewing.

-
-

6.

-
-

The system shows the details of the selected Playlist.

-
-

7.

-
-

The playlist editor deletes a playlist.

-
-

8.

-
-

The system deletes the playlist, than re-displays the list of - available Playlists.

-
-

9.

-
-

The Playlist editor disconnects.

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -

UC-4 Retrieve remote files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-4 -

-
-

use case -

-
-

Retrieve remote files -

-
-

type

-
-

primary, essential -

-
-

actors

-
-

(internal actor, initiator), Media archive, Local storage

-
-

purpose

-
-

Retrieve remote files referenced by active playlists and store - them in the local storage

-
-

overview

-
-

The daemon contacts the remote media archive and retrieves - audio clips referenced by active playlists. The clips are stored - locally for playing. -

-
-

references

-
-

F1.2 -

-
-


Note that this use case is somewhat reversed, as it is -initiated by the system (not an actor), and the main tasks are done -by an external actor (the Media archive).

-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

An Internal actor triggers the retrieval of some remote files. -

-
-

2. -

-
-

The system looks up the URN of the remote file, and determines - the Media archive to contact regarding the file. -

-
-


-

-
-


-

-
-

3.

-
-

The system contacts the Local storage and sends authorization - information

-
-

4.

-
-

Local storage authenticates the system and grants access

-
-

5.

-
-

The system iniquires the local storage about the availability - of the file to download in the Local storage by presenting its - unique ID

-
-

6.

-
-

Local storage tells if the required file is already stored or - not.

-
-

7.

-
-

If the file is available in the local storage, the use case - ends. Otherwise, it continues.

-
-


-

-
-


-

-
-

8.

-
-

The system contacts the Media archive and sends authorization - information -

-
-

9. -

-
-

Media archive authenticates the system and grants access -

-
-

10. -

-
-

The system requests an audio clip by presenting its unique ID -

-
-

11. -

-
-

Media archive looks up the file, and presents it to the system -

-
-

12. -

-
-

The system retrieves the file and closes the connection to the - Media archive

-
-


-

-
-


-

-
-

13.

-
-

The system presents the file to Local storage

-
-

14.

-
-

Local storage stores the file under the specified unique ID

-
-

15.

-
-

The system closes the connection to Local storage.

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -

UC-5 Review play log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-5 -

-
-

use case -

-
-

Review play log -

-
-

type -

-
-

secondary, essential -

-
-

actors -

-
-

Broadcast auditor -

-
-

purpose -

-
-

Review what has been played -

-
-

overview -

-
-

The Broadcast auditor reviews the audio clips that have been - played in a selected time interval. He may generate reports for - proof of broadcast reasons. -

-
-

references -

-
-

F1.4 -

-
-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Broadcast auditor connects to the scheduler daemon with the - intent of reviewing what has been played.

-
-


-

-
-


-

-
-

2. -

-
-

The Broadcast auditor provides authentication information -

-
-

3. -

-
-

The system authenticates the Broadcast auditor and grants - access. -

-
-

3.

-
-

The Broadcast auditor browses through the play log in a - time-ordered manner.

-
-

4.

-
-

The system displays the play log entries.

-
-

5.

-
-

The Broadcast auditor requests a play report for a given time - period.

-
-

6.

-
-

The system displays the requested report.

-
-

7.

-
-

The Broadcast auditor disconnects.

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -



-

-

UC-6 Create playlist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-6 -

-
-

use case -

-
-

Create playlist

-
-

type -

-
-

secondary, essential -

-
-

actors -

-
-

Playlist editor

-
-

purpose -

-
-

Create a new playlist, and then edit it.

-
-

overview -

-
-

The Playlist editor connects to the Scheduler with the aim of - creating a new playlist. A basic user interface is provided, which - allows professionals to create and edit the playlsits on the - system.

-
-

references -

-
-

F1.12, F1.13

-
-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Playlist editor connects to the scheduler with the intent of - creating a new playlist.

-
-


-

-
-


-

-
-

2. -

-
-

The Playlist editor provides authentication information -

-
-

3. -

-
-

The system authenticates the Playlist editor and grants access. -

-
-

4.

-
-

The Playlist editor signals that he whishes for a new playlist

-
-

5.

-
-

The system creates a new, empty playlist, and opens it for - editing.

-
-

6.

-
-

The Playlist editor edits the new playlist. See UC-7 actions - 7-15 for details.

-
-


-

-
-


-

-
-

7.

-
-

The Playlist editor disconnects.

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -



-

-

UC-7 Edit playlist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-7 -

-
-

use case -

-
-

Edit playlist

-
-

type -

-
-

secondary, essential -

-
-

actors -

-
-

Playlist editor

-
-

purpose -

-
-

Edit a previoulsy uploaded playlist

-
-

overview -

-
-

The Playlist editor connects to the Scheduler with the aim of - either editing an existing playlist. A basic user interface is - provided, which allows professionals to edit the playlsits on the - system.

-
-

references -

-
-

F1.12 -

-
-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

Playlist editor connects to the scheduler with the intent of - editing a playlist.

-
-


-

-
-


-

-
-

2. -

-
-

The Playlist editor provides authentication information -

-
-

3. -

-
-

The system authenticates the Playlist editor and grants access. -

-
-


-

-
-


-

-
-

4.

-
-

The system lists the available playlists.

-
-

5.

-
-

The Playlist editor selects a playlist for editing.

-
-

6.

-
-

The system opens the playlist in editing mode.

-
-

7.

-
-

The Playlist editor browses the available Audio clips

-
-

8.

-
-

The system shows the list of available audio clips

-
-

9.

-
-

The Playlist editor selects an Audio clip

-
-

10.

-
-

The system displays details on the audio clip.

-
-

11.

-
-

The Playlist editor ads a new audio clip to the playlist, at a - certain timepoint in the playlist.

-
-

12.

-
-

The new audio clip is added to the playlist.

-
-

13.

-
-

The Playlist editor removes an audio clip from the playlist.

-
-

14.

-
-

The audio clip is removed from the playlist.

-
-

15.

-
-

The Playlist editor edits the fade-in or fade-out of a clip in - the playlist.

-
-

16.

-
-

The fade-in or fade-out is edited.

-
-

17.

-
-

The Playlist editor saves the playlist.

-
-

18.

-
-

The playlist is validated.

-
-


-

-
-


-

-
-

19.

-
-

The playlist is saved.

-
-

20.

-
-

The Playlist editor disconnects.

-
-


-

-
-


-

-
-



-

-

Alternate courses

- -



-

-

UC-8 Start/stop scheduler

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ref# -

-
-

UC-8 -

-
-

use case -

-
-

Start/stop scheduler

-
-

type -

-
-

primary, essential -

-
-

actors -

-
-

Administrator

-
-

purpose -

-
-

Start and stop the scheduler daemon

-
-

overview -

-
-

The adminisitrator starts the scheduler deamon by invoking a - System V init-style startup script. He may also stop the deamon - with the same script.

-
-

references -

-
-

F1.14, F1.15, A1.8

-
-

Typical course of events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

actor action -

-
-

system response -

-
-

1. -

-
-

The Administrator invokes the scheduler's System V init script - with the start parameter

-
-


-

-
-


-

-
-


-

-
-


-

-
-

2. -

-
-

The scheduler daemon starts up.

-
-

3.

-
-

The Administrator checks to see if the scheduler daemon is - running

-
-

4.

-
-

The scheduler daemon reports that it is running.

-
-

5.

-
-

The Administrator stops the scheduler deamon.

-
-

6.

-
-

The scheduler daemon stops.

-
-



-

-

Alternate courses

- -

Conceptual model

-

The following figure displays the semantic concepts identified for -the Scheduler daemon, and the main associations between the -concepts.


-

-

Concepts

-


-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

concept

-
-

description

-
-

Media archive

-
-

An archive external to the system, which holds Audio clips. The - archive offers its clips for download by requesting clips based on - their unique ids.

-
-

Clip retriever

-
-

Retrieves Audio clips from the Media archive and stores them in - local storage.

-
-

Local storage

-
-

A local store of Audio clips. Provides access to each clip - based on the clips' unique id. Allows random access to the clip - files.

-
-

Audio clip

-
-

A uniquely identified audio file.

-
-

Playlist

-
-

A metafile, containing references to Audio clips, and - information on how the clips should be played.

-
-

PlaylistElement

-
-

An association class describing the specifics of an instance of - an Audio clip in a playlist.

-
-

FadeInfo

-
-

A class describing fade in or fade out characteristics for an - Audio clip in a Playlist

-
-

Playlist store

-
-

A container holding a range of playlists.

-
-

Schedule

-
-

Contains Schedule entries

-
-

Schedule entry

-
-

Contains the time and details of when a playlist should be - played.

-
-

Scheduler daemon

-
-

Executes playlists at timepoints specified by the schedule.

-
-

Play log

-
-

A logging facility, holding Play log entries.

-
-

Play log entry

-
-

A record of when an Audio clip was played.

-
-

Play report

-
-

An audit report of what Audio clips have been played in a - certain time period

-
-

Authentication

-
-

Provides authentication services

-
-

Playlist editor

-
-

An external editor, managing playlists.

-
-

Broadcast auditor

-
-

An external auditor, browsing the Play log.

-
-

Administrator

-
-

The administrator responsible for starting and stopping the - scheduler daemon.

-
-


-

-
-


-

-
-



-

-

Associations

-


-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

source

-
-

association

-
-

target

-
-

description

-
-

Clip retriever

-
-

Retrieves clips from

-
-

Media archive

-
-


-

-
-

Media archive

-
-

Contains

-
-

Audio clip

-
-


-

-
-

Clip retriever

-
-

Stores clips in

-
-

Local storage

-
-


-

-
-

Local storage

-
-

Contains

-
-

Audio clip

-
-


-

-
-

Playlist

-
-

References by PlaylistElement

-
-

Audio clip

-
-


-

-
-

PlaylistElement

-
-

Fades in with

-
-

FadeInfo

-
-


-

-
-

PlaylistElement

-
-

Fades out with

-
-

FadeInfo

-
-


-

-
-

Playlist store

-
-

Contains

-
-

Play list

-
-


-

-
-

Playlist editor

-
-

Uploads playlist to

-
-

Playlist store

-
-


-

-
-

Playlist editor

-
-

Manages schedule in

-
-

Schedule

-
-

The Playlist editor schedules playlists.

-
-

Schedule

-
-

Contains

-
-

Schedule entry

-
-


-

-
-

Schedule entry

-
-

References

-
-

Playlist

-
-


-

-
-

Scheduler daemon

-
-

Executes

-
-

Schedule

-
-

The Scheduler daemon plays the scheduled playlists.

-
-

Scheduler daemon

-
-

Logs into

-
-

Play log

-
-

The Scheduler daemon logs all the played audio clips into the - Play log for proof of broadcast purposes.

-
-

Play log

-
-

Contains

-
-

Play log entry

-
-


-

-
-

Play log

-
-

Generated

-
-

Play report

-
-

The play log generates reports based on Play log entries.

-
-

Play log entry

-
-

References

-
-

Audio clip

-
-


-

-
-

Broadcast auditor

-
-

Browses entries from

-
-

Play log

-
-


-

-
-

Broadcast auditor

-
-

Requests

-
-

Play report

-
-


-

-
-

Playlist editor

-
-

Is authenticated by

-
-

Authentication

-
-


-

-
-

Broadcast auditor

-
-

Is authenticated by

-
-

Authentication

-
-


-

-
-

Administrator

-
-

Manages

-
-

Scheduler daemon

-
-


-

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

System behavior

-

The behavior of the system as a whole as experienced from the -outside is discussed in this section.

-

System sequence diagrams

-

System diagrams are presented for each use case below.

-

UC-1 Upload playlists

-



-

-

UC-2 Manage schedule

-



-

-

UC-3 Manage playlists

-



-

-

UC-4 Retrieve remote files

-



-

-

UC-5 Review play log

-

UC-6 Create playlist

-

UC-7 Edit playlist

-

UC-8 Start/stop scheduler

-



-

-

System objects

-

The following figures shows the system objects and their -functions, as derived from the system sequence diagrams.

-

Contracts

-

For all operations exposed in the system sequence diagrams, the -following contracts are defined.

-

Contract for Scheduler : authenticate

-

See Authentication : authenticate

-

Contract for Scheduler : uploadPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

uploadPlaylist
(playlist : Playlist,
playtime: - Schedule)
: UniqueId

-
-

Responsibilities

-
-

Upload a playlist and put it into the schedule.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.1, UC-1

-
-

Notes

-
-


-

-
-

Exceptions

-
-

If the uploaded playlist is not valid, indicate as an error
If - the proposed schedule conflicts with existing schedules, indicate - as an error

-
-

Output

-
-

the unique id of the ScheduleEntry created with this upload

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

A new Playlist is created, storing the uploaded playlist

-
-

instance creation -

-
-


-

-
-

Playlist is entered into the Playlist store

-
-

association formed

-
-


-

-
-

A new Schedule is created, according to the supplied schedule

-
-

instance creation

-
-


-

-
-

Schedule is associated with the Playlist

-
-

association formed

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displaySchedule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displaySchedule
(from : TimeStamp,
to : TimeStamp)
: - Schedule

-
-

Responsibilities

-
-

Display Schedule entries for a time period.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.4, UC-2

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

The Schedule entries for the specified time period.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displayPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displayPlaylist
(playlistId : UniqueId)
: Playlist

-
-

Responsibilities

-
-

Display a specific playlist

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.4, UC-3

-
-

Notes

-
-


-

-
-

Exceptions

-
-

If no playlist exists for the specified playlistId, indicate as - an error.

-
-

Output

-
-

The requested playlist.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : deletePlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

deletePlaylist
(playlist : Playlist)
: void

-
-

Responsibilities

-
-

Delete a specific playlist

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.11, UC-3

-
-

Notes

-
-


-

-
-

Exceptions

-
-

If no playlist exists for the specified playlistId, indicate as - an error.
If the playlist is referenced by any Schedule entry, - indicate as an error.

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The playlist is removed from the Playlist store.

-
-

association broken

-
-


-

-
-

References by the playlist to Audio clips removed

-
-

association broken

-
-


-

-
-

The playlist is deleted

-
-

instance deletion

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : removeFromSchedule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

removeFromSchedule
(scheduleEntryId : UniqueId)
: bool

-
-

Responsibilities

-
-

Remove a specific playlist from a schedule entry

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.9, UC-2

-
-

Notes

-
-


-

-
-

Exceptions

-
-

If no ScheduleEntry by the specified scheduleEntryId exist, - indicate as an error.

-
-

Output

-
-

true if the specified entry was removed, false if it did not - exist.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

Reference to the playlist by the scheduleEntry is removed.

-
-

association broken

-
-


-

-
-

The ScheduleEntry specified by the scheduleEntryId is deleted

-
-

instance deletion

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : reschedule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

reschedule
(scheduleEntryId : UniqueId,
playtime : - TimeStamp)
: bool

-
-

Responsibilities

-
-

Change when a certain playlist is scheduled to play.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.10, UC-2

-
-

Notes

-
-


-

-
-

Exceptions

-
-

If no ScheduleEntry by the specified scheduleEntryId exist, - indicate as an error.
If the new playtime conflicts with other - schedule entries, indicate as an error.

-
-

Output

-
-

false on errors

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The time attribute of scheduleEntry is updated to the supplied - playtime.

-
-

attribute modification

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displayPlaylists

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displayPlaylists
()
: Playlist

-
-

Responsibilities

-
-

Display Playlists contained in the Playlist store

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.4, UC-3

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

The playlists contained in the Playlist store.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displayPlayLog

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displayPlayLog
()
: Play log

-
-

Responsibilities

-
-

Display Play log entries contained in the Play log

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.4, UC-5

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

The play log entries contained in the Play log.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : generatePlayReport

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

generatePlayReport
(from : TimeStamp,
to : TimeStamp)
: - Play report

-
-

Responsibilities

-
-

Present a report on what Audio clips have been played to the - Broadcast auditor.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.4, UC-5

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

A report on the played Audio clips played in the specified time - period.

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : createPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

createPlaylist
()
: Playlist

-
-

Responsibilities

-
-

Create a new playlist

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.12, UC-6

-
-

Notes

-
-

A new playlist is created, and is immediately locked for - editing.

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

A new Playlist is created

-
-

instance creation

-
-


-

-
-

The lockedForEditing attribute is set to true for the playlist

-
-

attribute modification

-
-


-

-
-

The playlist is added to the Playlist store

-
-

association formed

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : openPlaylistForEditing

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

openPlaylistForEditing
(playlist : Playlist)
: void

-
-

Responsibilities

-
-

Open a playlist for editing

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

A playlist is opened for editing. The playlist may not be - played when being edited. Also, active (currently executing) - playlists may not be opened for editing. This is in effect a lock, - which is released by saving the playlist.

-
-

Exceptions

-
-

if the playlist is currently being executed, indicate as an - error.

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The current version of the playlist is stored, in case the user - wants to revert to the last saved version (see - revertEditedPlaylist)

-
-

instance creation

-
-


-

-
-

The lockedForEditing attribute is set to true for the playlist

-
-

attribute modification

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : addAudioClipToPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

addAutioClipToPlaylist
(playlist : Playlist,
audioClip : - AudioClip,
relativeOffset : Time)
: void

-
-

Responsibilities

-
-

Add an Audio clip to a Playlist

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

The Audio clip is added to the playlist with the specified - relativeOffset from the beginning of the Playlist.

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

the Playlist is currently opened for editing

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The new PlaylistElement is created associating the playlist - with the audio clip, with the specified relativeOffset

-
-

association formed, instnace creation

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displayAudioClips

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displayAudioClips
()
: AudioClip

-
-

Responsibilities

-
-

Display the audio clips known to the Scheduler

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

none

-
-

Exceptions

-
-

none

-
-

Output

-
-

The Audio clips kown to the Scheduler

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : displayAudioClip

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

displayAudioClip
(audioClipId : UniqueId)
: AudioClip

-
-

Responsibilities

-
-

Display the audio clip specified by the audioClipId

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

none

-
-

Exceptions

-
-

if no audio clip by the specified id exists, indicate as an - error

-
-

Output

-
-

The Audio clip specified by the audioClipId

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : removeAudioClipFromPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

removeAutioClipFromPlaylist
(playlist : - Playlist,
relativeOffset: Time)
: void

-
-

Responsibilities

-
-

Remove an Audio clip at the given relative offset from a - Playlist

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

The Audio clip is removed from the Playlist.

-
-

Exceptions

-
-

If there is no Audio clip at the specified relative offset in - the playlist, indicate as an error.

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

the Playlist is currently opened for editing

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The PlaylistElement associating the AudioClip with the Playlist - is removed, with the related FadeInfo instances

-
-

instance deletion, association broken

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : updateFadeInFadeOut

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

updateFadeInFadeOut
(audioClip : AudioClip,
playlist : - Playlist)
: void

-
-

Responsibilities

-
-

Update the fade-in and fade-out parameters for an audio clip - playing in a playlist.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

none

-
-

Exceptions

-
-

If the Audio clip is not in the playlist, indicate as an error.

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

the Playlist is currently opened for editing

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The fade-in and fade-out parameters for the audio clip in the - playlist are updated

-
-

attribute modification

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : validatePlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

validatePlaylist
(playlist : Playlist)
: boolean

-
-

Responsibilities

-
-

Validate a playlist for being complete.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

The playlist is checked for being complete (not containing - silence) and other sanity criteria.

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : savePlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

savePlaylist
(playlist : Playlist)
: void

-
-

Responsibilities

-
-

The playlist is saved.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

none

-
-

Exceptions

-
-

If the playlist is not valid, indicate as an error.

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

the Playlist is currently opened for editing

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The lockedForEditing attriubute is set to false for the - playlist

-
-

attribute modification

-
-


-

-
-

The old version of the Playlist that could have been used for - reverting is deleted (see revertEditedPlaylist)

-
-

instance deletion

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : revertEditedPlaylist

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

revertEditedPlaylist
(playlist : Playlist)
: void

-
-

Responsibilities

-
-

Changes are discarded for a Playlist that is being edited.

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.13, UC-7

-
-

Notes

-
-

The contents of the playlist are reverted to the state prior to - when editing began on it.

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

the Playlist is currently opened for editing

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The contents of the Playlist are reverted to the last saved - version. This includes deleting all created PlaylistElement and - FadeInfo instances.

-
-

attribute modification, instance deletion

-
-


-

-
-

The lockedForEditing attriubute is set to false for the - playlist

-
-

attribute modification

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : start

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

start
()
: void

-
-

Responsibilities

-
-

Starts the scheduler daemon

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.14, UC-8

-
-

Notes

-
-

A System V init-style daemon starting entry point

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

The scheduler daemon is currently not running

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The scheduler daemon object is created

-
-

instance creation

-
-


-

-
-

All the necessary structures are created for the deamon to run

-
-

instance creation

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : isRunning

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

isRunning
()
: boolean

-
-

Responsibilities

-
-

Tells if the scheduler daemon is running

-
-

Type

-
-

system

-
-

Cross-reference

-
-

UC-8

-
-

Notes

-
-

A System V init-style daemon status entry point

-
-

Exceptions

-
-

none

-
-

Output

-
-

true of the daemon is running, false otherwise

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Scheduler : stop

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

stop
()
: void

-
-

Responsibilities

-
-

Stops the scheduler daemon

-
-

Type

-
-

system

-
-

Cross-reference

-
-

F1.15, UC-8

-
-

Notes

-
-

A System V init-style daemon stopping entry point

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

The scheduler daemon is currently running

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

The scheduler daemon object is deleted

-
-

instance deletion

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Media archive : authenticate

-

TODO: move to Media archive spec

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

authenticate
(authenticationInfo : AuthenticationInfo)
: - boolean

-
-

Responsibilities

-
-

Check if the provided authentication info is recognized.

-
-

Type

-
-

interface

-
-

Cross-reference

-
-

UC-4

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

true if the provided authentication is recognized, false - otherwise

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Media archive : retrieveAudioClip

-

TODO: move to Media archive spec

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

retrieveAudioClip
(clipId : UniqueId)
: AudioClip

-
-

Responsibilities

-
-

Retrieve an AudioClip specified by the supplied audio clip id.

-
-

Type

-
-

interface

-
-

Cross-reference

-
-

F1.2, UC-4

-
-

Notes

-
-


-

-
-

Exceptions

-
-

if no audio clip exists with the supplied id, indicate as an - error

-
-

Output

-
-

the requested audio clip

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

condition

-
-

type

-
-


-

-
-

A new Audio clip is created and filled with the contents of the - retrieved audio clip

-
-

instance creation -

-
-


-

-
-

Audio clip is entered into Local storage

-
-

association formed

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Local storage : authenticate

-

TODO: move to Local storage spec

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

authenticate
(authenticationInfo : AuthenticationInfo)
: - boolean

-
-

Responsibilities

-
-

Check if the provided authentication info is recognized.

-
-

Type

-
-

interface

-
-

Cross-reference

-
-

UC-4

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

true if the provided authentication is recognized, false - otherwise

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Local storage : existsAudioClip

-

TODO: move to Local storage spec

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

existsAudioClip
(audioClipId : UniqueId)
: boolean

-
-

Responsibilities

-
-

Tell if an audio clip by the provided unique id is stored in - the Local storage

-
-

Type

-
-

interface

-
-

Cross-reference

-
-

UC-4

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

true if an audio clip with the provided id exists, false - otherwise

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

none

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Contract for Local storage : storeAudioClip

-

TODO: move to Local storage spec

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Name

-
-

storeAudioClip
(audioClip : AudioClip)
: void

-
-

Responsibilities

-
-

Store an audio clip.

-
-

Type

-
-

interface

-
-

Cross-reference

-
-

UC-4

-
-

Notes

-
-


-

-
-

Exceptions

-
-

none

-
-

Output

-
-

none

-
-

Pre-conditions

-
-

none

-
-

Post-conditions

-
-

The supplied audio clip is stored in the storage.

-
-


-

-
-


-

-
-


-

-
-


-

-
-



-

-

Glossary

-

playlist
The playlist is a metafile, containing -references to audio clips that should be played, and details on how -they should be played.

- - \ No newline at end of file + + + + + LiveSupport Scheduler specifications + + + +

Preface

+This document is part of the LiveSupport +project, Copyright © 2004 Media +Development Loan Fund, under the GNU GPL.
+ +

Scope

+This document contains the specification of the LiveSupport Scheduler +daemon.
+
+This document contains embedded SVG figures, thus an SVG +capable browser is needed to view it, or an SVG plugin like Adobe's SVG Viewer.
+

Requirements

+

Overview
+

+The purpose of the LiveSupport Scheduler daemon is to execute +playlists.
+

Goals
+

+The scheduler daemon is a remotely accessible service accepting +playlists on a local audio interface. Specific goals include:
+ +

System functions

+The main system functions are described below. There are three +categories for these functions:
+ + + + + + + + + + + + + + + + + + + +
function category
+
meaning
+
evident
+
Should perform, and the user should be cognizant +that it is performed
+
hidden
+
Should perform, but not visible to the users.
+
frill
+
Optional
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref#
+
function
+
category
+
F1.1
+
Accept uploaded playlists
+
evident
+
F1.2
+
Retrieve remote files referenced by playlists
+
hidden
+
F1.3
+
Access local files
+
hidden
+
F1.4
+
Provide status information
+
evident
+
F1.5
+
Log playlist execution for proof of broadcast +reasons
+
evident
+
F1.6
+
Purge local file storage of unused audio clips
+
hidden
+
F1.7
+
Execute playlists
+
evident
+
F1.8
+
Play live streams as part of the playlist
+
hidden
+
F1.9
+
Remove playists from the schedule
+
evident
+
F1.10
+
Re-schedule playlsits
+
evident
+
F1.11
+
Delete playlists
+
evident
+
F1.12
+
Create playlists
+
evident
+
F1.13
+
Edit playlists
+
evident
+
F1.14
+
Start the scheduler daemon
+
evident
+
F1.15
+
Stop the scheduler daemon
+
evident
+

+

+

+
+
+

System attributes

+Generic attributes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref#
+
attribute
+
details and constraints
+
category
+
A1.1
+
operating system platform
+
Linux
+
must
+
A1.2
+
supported audio interfaces
+
ALSA (maybe also OSS?)
+
must
+
A1.3
+
supported playlist format
+
SMIL 2.0. only partial support is required, +which focuses only on audio aspects of SMIL.
+
must
+
A1.4
+
supported audio clip formats
+
Ogg Vorbis, mp3, wav
+
must
+

+

+

+

+
+
+Attributes related to system functions
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref#
+
function
+
ref#
+
attribute
+
details and constraints
+
category
+
F1.7
+
Execute playlists
+
A1.5
+
low latency
+
when executing playlists, very low latency +should be achieved
+
must
+

+

+
A1.6
+
handle time skew
+
the +daemon has to take into account that the system's clock is not +accurate. the clock is synchronized to an external regularly, but the +resulting time-jump must be handled.
+
must
+
F1.8
+
Play live streams as part of the playlist A1.7
+
supported audio stream formats
+
Ogg Vorbis via HTTP, mp3 via HTTP
+
must
+
F1.14
+F1.15
+
Start / stop the scheduler daemon
+
A1.8
+
provide System V init style services
+
Provide a System V init interface to starting +and stopping the scheduler daemon
+
must
+

+

+

+

+

+

+
+
+

Essential use cases

+This section lists generic (essential) uses cases, that do not contain +architecture-specific considerations.
+
+ +

UC-1 Upload playlist

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-1
use case Upload playlist
type primary, essential
actors Playlist editor
purpose Upload a playlist
overview The Playlist editor uploads a new playlist.
references F1.1
+

Typical course of events

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Playlist editor connects to the scheduler daemon +with the intent of uploading a new playlist.
+

+

+
2. The Playlist editor provides authentication +information 3. The system authenticates the Playlist editor and +grants access.
4. The Playlist editor presents the new playlist +and the intended schedule for the playlist.
+
5. The system validates the new playlist, and sees +that it does not conflict with existing schedule.

+

+
6. The system stores the new playlist, adds it to +the schedule, and sends confirmation to the Playlist editor.
7. The Playlist editor receives confirmation and +disconnects.
+

+

+

+

+

+
+
+

Alternate courses

+ +

UC-2 Manage schedule
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref#
+
UC-2
use case Manage schedule
type
+
primary, essential
actors
+
Playlist editor
purpose
+
View the schedule and remove or re-schedule +playlists
+
overview
+
The Playlist editor reviews the schedule. If he +decides to, he might remove or re-schedule some of these playlists.
references
+
F1.4, F1.9, F1.10
+
+
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Playlist editor connects to the scheduler daemon +with the intent of viewing and editing the schedule.
+

+

+
2. The Playlist editor provides authentication +information 3. The system authenticates the Playlist editor and +grants access.

+

+
4.
+
The system shows the Schedule to the Playlist +editor
+
5.
+
The Playlist editor browses the Schedule, +selects a playlist for detailed viewing.
+
6.
+
The system shows the details of the selected +Playlist.
+
7.
+
The playlist editor removes a playlist from the +schedule.
+
8.
+
The system removes the playlist from the +schedule, than re-displays the updated schedle.
+
9.
+
The Playlist editor re-schedules a playlist
+
10.
+
The system removes the selected playlist from +the schedule, and re-enters it at a new timepoint
+
11.
+
The Playlist editor browses the Schedule
+
12.
+
The system shows the Schedule to the playlist +editor
+
13.
+
The Playlist editor disconnects.
+

+

+
+
+

Alternate courses

+ +

UC-3 Manage playlists
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref#
+
UC-3
use case Manage playlists
type
+
primary, essential
actors
+
Playlist editor
purpose
+
View and delete playlists
overview
+
The Playlist editor reviews the uploaded +playlists. If he decides so, he might delete some of these playlists.
references
+
F1.4, F1.11
+
+
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Playlist editor connects to the scheduler daemon +with the intent of viewing and deleting playlists.
+

+

+
2. The Playlist editor provides authentication +information 3. The system authenticates the Playlist editor and +grants access.

+

+
4.
+
The system lists the available Playlists
+
5.
+
The Playlist editor browses the playlists, and +selects one for detailed viewing.
+
6.
+
The system shows the details of the selected +Playlist.
+
7.
+
The playlist editor deletes a playlist.
+
8.
+
The system deletes the playlist, than +re-displays the list of available Playlists.
+
9.
+
The Playlist editor disconnects.
+

+

+
+
+

Alternate courses

+ +

UC-4 Retrieve remote files
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-4
use case Retrieve remote files
type
+
primary, essential
actors
+
(internal actor, initiator), Media archive, +Local storage
+
purpose
+
Retrieve remote files referenced by active +playlists and store them in the local storage
+
overview
+
The +daemon contacts the remote media archive and retrieves audio clips +referenced by active playlists. The clips are stored locally for +playing.
references
+
F1.2
+
+Note that this use case is somewhat reversed, as it is initiated by the +system (not an actor), and the main tasks are done by an external actor +(the Media archive).
+

Typical course of events

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. An Internal actor triggers the retrieval of some +remote files.
+
2. The system looks up the URN of the remote file, +and determines the Media archive to contact regarding the file.

+

+
3.
+
The system contacts the Local storage and sends +authorization information
+
4.
+
Local storage authenticates the system and +grants access
+
5.
+
The system iniquires the local storage about the +availability of the file to download in the Local storage by presenting +its unique ID
+
6.
+
Local storage tells if the required file is +already stored or not.
+
7.
+
If the file is available in the local storage, +the use case ends. Otherwise, it continues.
+

+

+
8.
+
The system contacts the Media archive and sends +authorization information
9. Media archive authenticates the system and +grants access 10. The system requests an audio clip by presenting +its unique ID
11. Media archive looks up the file, and presents it +to the system 12. The system retrieves the file and closes the +connection to the Media archive
+

+

+
13.
+
The system presents the file to Local storage
+
14.
+
Local storage stores the file under the +specified unique ID
+
15.
+
The system closes the connection to Local +storage.
+

+

+

+

+
+
+

Alternate courses

+ +

UC-5 Review play log
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-5
use case Review play log
type secondary, essential
actors Broadcast auditor
purpose Review what has been played
overview The +Broadcast auditor reviews the audio clips that have been played in a +selected time interval. He may generate reports for proof of broadcast +reasons.
references F1.4
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Broadcast auditor connects to the scheduler +daemon with the intent of reviewing what has been played.
+

+

+
2. The Broadcast auditor provides authentication +information 3. The system authenticates the Broadcast auditor +and grants access.
3.
+
The Broadcast auditor browses through the play +log in a time-ordered manner.
+
4.
+
The system displays the play log entries.
+
5.
+
The Broadcast auditor requests a play report for +a given time period.
+
6.
+
The system displays the requested report.
+
7.
+
The Broadcast auditor disconnects.
+

+

+

+

+

+

+
+
+

Alternate courses

+ +
+

UC-6 Create playlist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-6
use case Create playlist
+
type secondary, essential
actors Playlist editor
+
purpose Create a new playlist, and then edit it.
+
overview The Playlist editor connects to the Scheduler +with the aim of creating a new playlist. A basic user interface is +provided, which allows professionals to create and edit the playlsits +on the system.
+
references F1.12, F1.13
+
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Playlist editor connects to the scheduler with +the intent of creating a new playlist.
+

+

+
2. The Playlist editor provides authentication +information 3. The system authenticates the Playlist editor and +grants access.
4.
+
The Playlist editor signals that he whishes for +a new playlist
+
5.
+
The system creates a new, empty playlist, and +opens it for editing.
+
6.
+
The Playlist editor edits the new playlist. See +UC-7 actions 7-15 for details.
+

+

+
7.
+
The Playlist editor disconnects.
+

+

+

+

+

+

+
+
+

Alternate courses

+ +
+

UC-7 Edit playlist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-7
use case Edit playlist
+
type secondary, essential
actors Playlist editor
+
purpose Edit a previoulsy uploaded playlist
+
overview The Playlist editor connects to the +Scheduler with the aim of either editing an existing playlist. A basic +user interface is provided, which allows +professionals to edit the playlsits on the system.
+
references F1.12
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. Playlist editor connects to the scheduler with +the intent of editing a playlist.
+

+

+
2. The Playlist editor provides authentication +information 3. The system authenticates the Playlist editor and +grants access.

+

+
4.
+
The system lists the available playlists.
+
5.
+
The Playlist editor selects a playlist for +editing.
+
6.
+
The system opens the playlist in editing mode.
+
7.
+
The Playlist editor browses the available Audio +clips
+
8.
+
The system shows the list of available audio +clips
+
9.
+
The Playlist editor selects an Audio clip
+
10.
+
The system displays details on the audio clip.
+
11.
+
The Playlist editor ads a new audio clip to the +playlist, at a certain timepoint in the playlist.
+
12.
+
The new audio clip is added to the playlist.
+
13.
+
The Playlist editor removes an audio clip from +the playlist.
+
14.
+
The audio clip is removed from the playlist.
+
15.
+
The Playlist editor edits the fade-in or +fade-out of a clip in the playlist.
+
16.
+
The fade-in or fade-out is edited.
+
17.
+
The Playlist editor saves the playlist.
+
18.
+
The playlist is validated.
+

+

+
19.
+
The playlist is saved.
+
20.
+
The Playlist editor disconnects.
+

+

+
+
+

Alternate courses

+ +
+

UC-8 Start/stop scheduler
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ref# UC-8
use case Start/stop scheduler
+
type primary, essential
actors Administrator
+
purpose Start and stop the scheduler daemon
+
overview The adminisitrator starts the scheduler deamon +by invoking a System V init-style startup script. He may also stop the +deamon with the same script.
+
references F1.14, F1.15, A1.8
+
+

Typical course of events
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
actor action
+
system response
+
1. The Administrator invokes the scheduler's System +V init script with the start parameter
+

+

+

+

+
2. The scheduler daemon starts up.
+
3.
+
The Administrator checks to see if the scheduler +daemon is running
+
4.
+
The scheduler daemon reports that it is running.
+
5.
+
The Administrator stops the scheduler deamon.
+
6.
+
The scheduler daemon stops.
+
+
+

Alternate courses

+ +

Conceptual model

+The following figure displays the semantic concepts identified for the +Scheduler daemon, and the main associations between the concepts.
+
+ +
+

Concepts

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
concept
+
description
+
Media archive
+
An archive external to the system, which holds +Audio clips. The archive offers its clips for download by requesting +clips based on their unique ids.
+
Clip retriever
+
Retrieves Audio clips from the Media archive and +stores them in local storage.
+
Local storage
+
A local store of Audio clips. Provides access to +each clip based on the clips' unique id. Allows random access to the +clip files.
+
Audio clip
+
A uniquely identified audio file.
+
Playlist
+
A metafile, containing references to Audio +clips, and information on how the clips should be played.
+
PlaylistElement
+
An association class describing the specifics of +an instance of an Audio clip in a playlist.
+
FadeInfo
+
A class describing fade in or fade out +characteristics for an Audio clip in a Playlist
+
Playlist store
+
A container holding a range of playlists.
+
Schedule
+
Contains Schedule entries
+
Schedule entry
+
Contains the time and details of when a playlist +should be played.
+
Scheduler daemon
+
Executes playlists at timepoints specified by +the schedule.
+
Play log
+
A logging facility, holding Play log entries.
+
Play log entry
+
A record of when an Audio clip was played.
+
Play report
+
An audit report of what Audio clips have been +played in a certain time period
+
Authentication
+
Provides authentication services
+
Playlist editor
+
An external editor, managing playlists.
+
Broadcast auditor
+
An external auditor, browsing the Play log.
+
Administrator
+
The administrator responsible for starting and +stopping the scheduler daemon.
+

+

+
+
+

Associations

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source
+
association
+
target
+
description
+
Clip retriever
+
Retrieves clips from
+
Media archive
+

+
Media archive
+
Contains
+
Audio clip
+

+
Clip retriever
+
Stores clips in
+
Local storage
+

+
Local storage
+
Contains
+
Audio clip
+

+
Playlist
+
References by PlaylistElement
+
Audio clip
+

+
PlaylistElement
+
Fades in with
+
FadeInfo
+

+
PlaylistElement
+
Fades out with
+
FadeInfo
+

+
Playlist store
+
Contains
+
Play list
+

+
Playlist editor
+
Uploads playlist to
+
Playlist store
+

+
Playlist editor
+
Manages schedule in
+
Schedule
+
The Playlist editor schedules playlists.
+
Schedule
+
Contains
+
Schedule entry
+

+
Schedule entry
+
References
+
Playlist
+

+
Scheduler daemon
+
Executes
+
Schedule
+
The Scheduler daemon plays the scheduled +playlists.
+
Scheduler daemon
+
Logs into
+
Play log
+
The Scheduler daemon logs all the played audio +clips into the Play log for proof of broadcast purposes.
+
Play log
+
Contains
+
Play log entry
+

+
Play log
+
Generated
+
Play report
+
The play log generates reports based on Play log +entries.
+
Play log entry
+
References
+
Audio clip
+

+
Broadcast auditor
+
Browses entries from
+
Play log
+

+
Broadcast auditor
+
Requests
+
Play report
+

+
Playlist editor
+
Is authenticated by
+
Authentication
+

+
Broadcast auditor
+
Is authenticated by
+
Authentication
+

+
Administrator
+
Manages
+
Scheduler daemon
+

+

+

+

+

+
+
+

System behavior

+The behavior of the system as a whole as experienced from the outside +is discussed in this section.
+

System sequence diagrams

+System diagrams are presented for each use case below.
+

UC-1 Upload playlists

+ +
+

UC-2 Manage schedule

+ +
+

UC-3 Manage playlists

+ +
+

UC-4 Retrieve remote files
+

+ +
+

UC-5 Review play log

+ +

UC-6 Create playlist

+ +

UC-7 Edit playlist
+ +

+

UC-8 Start/stop scheduler

+ +
+
+

System objects

+The following figures shows the system objects and their functions, as +derived from the system sequence diagrams.
+ +

Contracts

+For all operations exposed in the system sequence diagrams, the +following contracts are defined.
+

Contract for Scheduler : authenticate

+See Authentication : authenticate
+
+

Contract for Scheduler : uploadPlaylist

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
uploadPlaylist
+(playlist : Playlist,
+playtime: Schedule)
+: UniqueId
+
Responsibilities
+
Upload a playlist and +put it into the schedule.
+
Type
+
system
+
Cross-reference
+
F1.1, UC-1
+
Notes
+

+
Exceptions
+
If the uploaded playlist +is not valid, indicate as an error
+If the proposed schedule conflicts with existing schedules, indicate as +an error
+
Output
+
the unique id of the +ScheduleEntry created with this upload
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
A new Playlist is created, storing the uploaded +playlist
+
instance creation

+
Playlist is entered into the Playlist store
+
association formed
+

+
A new Schedule is created, according to the +supplied schedule
+
instance creation
+

+
Schedule is associated with the Playlist
+
association formed
+

+

+

+
+
+

Contract for Scheduler : displaySchedule

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displaySchedule
+(from : TimeStamp,
+to : TimeStamp)
+: Schedule
+
Responsibilities
+
Display Schedule entries +for a time period.
+
Type
+
system
+
Cross-reference
+
F1.4, UC-2
+
Notes
+

+
Exceptions
+
none
+
Output
+
The Schedule entries for +the specified time period.
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : displayPlaylist

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayPlaylist
+(playlistId : UniqueId)
+: Playlist
+
Responsibilities
+
Display a specific +playlist
+
Type
+
system
+
Cross-reference
+
F1.4, UC-3
+
Notes
+

+
Exceptions
+
If no playlist exists +for the specified playlistId, indicate as an error.
+
Output
+
The requested playlist.
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : deletePlaylist

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayPlaylist
+(playlist : Playlist)
+: void
+
Responsibilities
+
Delete a specific +playlist
+
Type
+
system
+
Cross-reference
+
F1.11, UC-3
+
Notes
+

+
Exceptions
+
If no playlist exists +for the specified playlistId, indicate as an error.
+If the playlist is referenced by any Schedule entry, indicate as an +error.
+
Output
+
none
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
The playlist is removed from the Playlist store.
+
association broken
+

+
References by the playlist to Audio clips removed
+
association broken
+

+
The playlist is deleted
+
instance deletion
+

+

+

+
+
+

Contract for Scheduler : removeFromSchedule
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
removeFromSchedule
+(scheduleEntryId : UniqueId)
+: bool
+
Responsibilities
+
Remove a specific +playlist from a schedule entry
+
Type
+
system
+
Cross-reference
+
F1.9, UC-2
+
Notes
+

+
Exceptions
+
If no ScheduleEntry by +the specified +scheduleEntryId exist, indicate as an error.
+
Output
+
true if the specified +entry was removed, false if it did not exist.
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
Reference to the playlist by the scheduleEntry +is removed.
+
association broken
+

+
The ScheduleEntry specified by the +scheduleEntryId is deleted
+
instance deletion
+

+

+

+
+
+

Contract for Scheduler : reschedule
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
reschedule
+(scheduleEntryId : UniqueId,
+playtime : TimeStamp)
+: bool
+
Responsibilities
+
Change when a certain +playlist is scheduled to play.
+
Type
+
system
+
Cross-reference
+
F1.10, UC-2
+
Notes
+

+
Exceptions
+
If no ScheduleEntry by +the specified +scheduleEntryId exist, indicate as an error.
+If the new playtime conflicts with other schedule entries, indicate as +an error.
+
Output
+
false on errors
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
The time attribute of scheduleEntry is updated +to the supplied playtime.
+
attribute modification
+

+

+

+
+
+

Contract for Scheduler : displayPlaylists

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayPlaylists
+()
+: Playlist
+
Responsibilities
+
Display Playlists +contained in the Playlist store
+
Type
+
system
+
Cross-reference
+
F1.4, UC-3
+
Notes
+

+
Exceptions
+
none
+
Output
+
The playlists contained +in the Playlist store.
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : displayPlayLog

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayPlaylists
+()
+: Play log
+
Responsibilities
+
Display Play log entries +contained in the Play log
+
Type
+
system
+
Cross-reference
+
F1.4, UC-5
+
Notes
+

+
Exceptions
+
none
+
Output
+
The play log entries +contained in the Play log.
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : generatePlayReport
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
generatePlayReport
+(from : TimeStamp,
+to : TimeStamp)
+: Play report
+
Responsibilities
+
Present a report on what +Audio clips have been played to the Broadcast auditor.
+
Type
+
system
+
Cross-reference
+
F1.4, UC-5
+
Notes
+

+
Exceptions
+
none
+
Output
+
A report on the played +Audio clips played in the specified time period.
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : createPlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
createPlaylist
+()
+: Playlist
+
Responsibilities
+
Create a new playlist
+
Type
+
system
+
Cross-reference
+
F1.12, UC-6
+
Notes
+
A new playlist is +created, and is immediately locked for editing.
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
A new Playlist is created
+
instance creation
+

+
The lockedForEditing attribute is set to true +for the playlist
+
attribute modification
+

+
The playlist is added to the Playlist store
+
association formed
+

+

+

+
+
+

Contract for Scheduler : openPlaylistForEditing
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
openPlaylistForEditing
+(playlist : Playlist)
+: void
+
Responsibilities
+
Open a playlist for +editing
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
A playlist is opened for +editing. Active (currently executing) playlists may not be opened for +editing. The playlist may start executing while being edited: in this case, +editing is suspended while the playlist is executing and resumed afterwards. +This is in effect a lock, which is released by saving the playlist.
+
Exceptions
+
if the playlist is +currently being executed, indicate as an error.
+
Output
+
none
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
The current version of the playlist is stored, +in case the user wants to revert to the last saved version (see +revertEditedPlaylist)
+
instance creation
+

+
The lockedForEditing attribute is set to true +for the playlist
+
attribute modification
+

+

+

+
+
+

Contract for Scheduler : addAudioClipToPlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
addAutioClipToPlaylist
+(playlist : Playlist,
+audioClip : AudioClip,
+relativeOffset : Time)
+: void
+
Responsibilities
+
Add an Audio clip to a +Playlist
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
The Audio clip is added +to the playlist with the specified relativeOffset from the beginning of +the Playlist.
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
the Playlist is +currently opened for editing
+
Post-conditions
+
condition
+
type
+

+
The new PlaylistElement is created associating +the playlist with the audio clip, with the specified relativeOffset
+
association formed, instnace creation
+

+

+

+
+
+

Contract for Scheduler : displayAudioClips
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayAudioClips
+()
+: AudioClip
+
Responsibilities
+
Display the audio clips +known to the Scheduler
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
none
+
Exceptions
+
none
+
Output
+
The Audio clips kown to +the Scheduler
+
Pre-conditions
+
none
+
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : displayAudioClip
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
displayAudioClip
+(audioClipId : UniqueId)
+: AudioClip
+
Responsibilities
+
Display the audio clip +specified by the audioClipId
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
none
+
Exceptions
+
if no audio clip by the +specified id exists, indicate as an error
+
Output
+
The Audio clip specified +by the audioClipId
+
Pre-conditions
+
none
+
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : removeAudioClipFromPlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
removeAutioClipFromPlaylist
+(playlist : Playlist,
+relativeOffset: Time)
+: void
+
Responsibilities
+
Remove an Audio clip +from a Playlist
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
The Audio clip is +removed from the Playlist.
+
Exceptions
+
If the Audio clip is not +in the playlist, indicate as an error.
+
Output
+
none
+
Pre-conditions
+
the Playlist is +currently opened for editing
+
Post-conditions
+
condition
+
type
+

+
The PlaylistElement associating the AudioClip +with the Playlist is removed, with the related FadeInfo instances
+
instance deletion, association broken
+

+

+

+
+
+

Contract for Scheduler : updateFadeInFadeOut
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
updateFadeInFadeOut
+(audioClip : AudioClip,
+playlist : Playlist)
+: void
+
Responsibilities
+
Update the fade-in and +fade-out parameters for an audio clip playing in a playlist.
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
none
+
Exceptions
+
If the Audio clip is not +in the playlist, indicate as an error.
+
Output
+
none
+
Pre-conditions
+
the Playlist is +currently opened for editing
+
Post-conditions
+
condition
+
type
+

+
The fade-in and fade-out parameters for the +audio clip in the playlist are updated
+
attribute modification
+

+

+

+
+
+

Contract for Scheduler : validatePlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
validatePlaylist
+(playlist : Playlist)
+: boolean
+
Responsibilities
+
Validate a playlist for +being complete.
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
The playlist is checked +for being complete (not containing silence) and other sanity criteria.
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
none
+
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : savePlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
savePlaylist
+(playlist : Playlist)
+: void
+
Responsibilities
+
The playlist is saved.
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
none
+
Exceptions
+
If the playlist is not +valid, indicate as an error.
+
Output
+
none
+
Pre-conditions
+
the Playlist is +currently opened for editing
+
Post-conditions
+
condition
+
type
+

+
The lockedForEditing attriubute is set to false +for the playlist
+
attribute modification
+

+
The old version of the Playlist that could have +been used for reverting is deleted (see revertEditedPlaylist)
+
instance deletion
+

+

+

+
+
+

Contract for Scheduler : revertEditedPlaylist
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
revertEditedPlaylist
+(playlist : Playlist)
+: void
+
Responsibilities
+
Changes are discarded +for a Playlist that is being edited.
+
Type
+
system
+
Cross-reference
+
F1.13, UC-7
+
Notes
+
The contents of the +playlist are reverted to the state prior to when editing began on it.
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
the Playlist is +currently opened for editing
+
Post-conditions
+
condition
+
type
+

+
The contents of the Playlist are reverted to the +last saved version. This includes deleting all created PlaylistElement +and FadeInfo instances.
+
attribute modification, instance deletion
+

+
The lockedForEditing attriubute is set to false +for the playlist
+
attribute modification
+

+

+

+
+
+

Contract for Scheduler : start
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
start
+()
+: void
+
Responsibilities
+
Starts the scheduler +daemon
+
Type
+
system
+
Cross-reference
+
F1.14, UC-8
+
Notes
+
A System V init-style +daemon starting entry point
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
The scheduler daemon is +currently not running
+
Post-conditions
+
condition
+
type
+

+
The scheduler daemon object is created
+
instance creation
+

+
All the necessary structures are created for the +deamon to run
+
instance creation
+

+

+

+
+
+

Contract for Scheduler : isRunning
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
isRunning
+()
+: boolean
+
Responsibilities
+
Tells if the scheduler +daemon is running
+
Type
+
system
+
Cross-reference
+
UC-8
+
Notes
+
A System V init-style +daemon status entry point
+
Exceptions
+
none
+
Output
+
true of the daemon is +running, false otherwise
+
Pre-conditions
+
none
+
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Scheduler : stop
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
stop
+()
+: void
+
Responsibilities
+
Stops the scheduler +daemon
+
Type
+
system
+
Cross-reference
+
F1.15, UC-8
+
Notes
+
A System V init-style +daemon stopping entry point
+
Exceptions
+
none
+
Output
+
none
+
Pre-conditions
+
The scheduler daemon is +currently running
+
Post-conditions
+
condition
+
type
+

+
The scheduler daemon object is deleted
+
instance deletion
+

+

+

+
+
+

Contract for Media archive : authenticate

+TODO: move to Media archive spec
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
authenticate
+(authenticationInfo : AuthenticationInfo)
+: boolean
+
Responsibilities
+
Check if the provided +authentication info is recognized.
+
Type
+
interface
+
Cross-reference
+
UC-4
+
Notes
+

+
Exceptions
+
none
Output
+
true if the provided +authentication is recognized, false otherwise
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Media archive : retrieveAudioClip

+TODO: move to Media archive spec
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
retrieveAudioClip
+(clipId : UniqueId)
+: AudioClip
+
Responsibilities
+
Retrieve an AudioClip +specified by the supplied audio clip id.
+
Type
+
interface
+
Cross-reference
+
F1.2, UC-4
+
Notes
+

+
Exceptions
+
if no audio clip exists +with the supplied id, indicate as an error
+
Output
+
the requested audio clip
+
Pre-conditions
+
none
Post-conditions
+
condition
+
type
+

+
A new Audio clip is created and filled with the +contents of the retrieved audio clip
+
instance creation

+
Audio clip is entered into Local storage
+
association formed
+

+

+

+
+
+

Contract for Local storage : authenticate

+TODO: move to Local storage spec
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
authenticate
+(authenticationInfo : AuthenticationInfo)
+: boolean
+
Responsibilities
+
Check if the provided +authentication info is recognized.
+
Type
+
interface
+
Cross-reference
+
UC-4
+
Notes
+

+
Exceptions
+
none
Output
+
true if the provided +authentication is recognized, false otherwise
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Local storage : existsAudioClip

+TODO: move to Local storage spec
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
existsAudioClip
+(audioClipId : UniqueId)
+: boolean
+
Responsibilities
+
Tell if an audio clip by +the provided unique id is stored in the Local storage
+
Type
+
interface
+
Cross-reference
+
UC-4
+
Notes
+

+
Exceptions
+
none
Output
+
true if an audio clip +with the provided id exists, false otherwise
+
Pre-conditions
+
none
Post-conditions
+
none
+

+

+

+

+
+
+

Contract for Local storage : storeAudioClip

+TODO: move to Local storage spec
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
+
storeAudioClip
+(audioClip : AudioClip)
+: void
+
Responsibilities
+
Store an audio clip.
+
Type
+
interface
+
Cross-reference
+
UC-4
+
Notes
+

+
Exceptions
+
none
Output
+
none
+
Pre-conditions
+
none
Post-conditions
+
The supplied audio clip is stored in the storage.
+

+

+

+

+
+
+

Glossary

+playlist
+The playlist is a metafile, containing references to audio clips that +should be played, and details on how they should be played.
+
+ + diff --git a/livesupport/modules/core/include/LiveSupport/Core/Playlist.h b/livesupport/modules/core/include/LiveSupport/Core/Playlist.h index 99544b3e6..e46ea0dc2 100644 --- a/livesupport/modules/core/include/LiveSupport/Core/Playlist.h +++ b/livesupport/modules/core/include/LiveSupport/Core/Playlist.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/Playlist.h,v $ ------------------------------------------------------------------------------*/ @@ -71,7 +71,7 @@ using namespace boost::posix_time; * the playlist. * * @author $Author: fgerlits $ - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ class Playlist : public Configurable { @@ -124,6 +124,11 @@ class Playlist : public Configurable addPlaylistElement(Ptr::Ref playlistElement) throw (std::invalid_argument); + /** + * A saved copy of this playlist. + */ + Ptr::Ref savedCopy; + public: /** @@ -308,6 +313,30 @@ class Playlist : public Configurable bool valid(void) throw (); + + /** + * Create a saved copy of this playlist. If a saved copy exists + * already, it is replaced by the current state. + */ + void + createSavedCopy(void) throw (); + + /** + * Delete the saved copy of the playlist, if exists (or do nothing). + */ + void + deleteSavedCopy(void) throw () + { + savedCopy.reset(); + } + + /** + * Revert to the saved copy of this playlist. If there is no + * saved copy, do nothing and throw an exception. + */ + void + revertToSavedCopy(void) throw (std::logic_error); + }; diff --git a/livesupport/modules/core/src/Playlist.cxx b/livesupport/modules/core/src/Playlist.cxx index 96d3935f9..c0be4a50f 100644 --- a/livesupport/modules/core/src/Playlist.cxx +++ b/livesupport/modules/core/src/Playlist.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/Playlist.cxx,v $ ------------------------------------------------------------------------------*/ @@ -253,3 +253,44 @@ Playlist::valid(void) throw () playlength = runningTime; // fix playlength, if everything else is OK return true; } + + +/*------------------------------------------------------------------------------ + * Create a saved copy of the playlist. + *----------------------------------------------------------------------------*/ +void +Playlist::createSavedCopy(void) throw () +{ + savedCopy = Ptr::Ref(new Playlist); + + savedCopy->id = this->id; + savedCopy->playlength = this->playlength; + savedCopy->isLockedForPlaying = this->isLockedForPlaying; + savedCopy->isLockedForEditing = this->isLockedForEditing; + + // note: we create a new copy of the playlist element map, but not of the + // individual playlist elements, which (i think) are immutable + savedCopy->elementList.reset(new PlaylistElementListType(*elementList)); + + savedCopy->savedCopy.reset(); +} + + +/*------------------------------------------------------------------------------ + * Revert to a saved copy of the playlist. + *----------------------------------------------------------------------------*/ +void +Playlist::revertToSavedCopy(void) throw (std::logic_error) +{ + if (savedCopy == 0) { + throw (std::logic_error("playlist has no saved copy")); + } + + this->id = savedCopy->id; + this->playlength = savedCopy->playlength; + this->isLockedForPlaying = savedCopy->isLockedForPlaying; + this->isLockedForEditing = savedCopy->isLockedForEditing; + this->elementList = savedCopy->elementList; + + savedCopy.reset(); +} diff --git a/livesupport/modules/core/src/PlaylistTest.cxx b/livesupport/modules/core/src/PlaylistTest.cxx index 0a5bd70db..f452b1098 100644 --- a/livesupport/modules/core/src/PlaylistTest.cxx +++ b/livesupport/modules/core/src/PlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -233,3 +233,49 @@ PlaylistTest :: audioClipTest(void) CPPUNIT_FAIL("removeAudioClip allowed to remove " "non-existent audio clip"); } + + +/*------------------------------------------------------------------------------ + * Test the "save/revert to current state" mechanism + *----------------------------------------------------------------------------*/ +void +PlaylistTest :: savedCopyTest(void) + throw (CPPUNIT_NS::Exception) +{ + try { + playlist->revertToSavedCopy(); + CPPUNIT_FAIL("allowed to revert to non-existent state"); + } + catch (std::logic_error &e) { + } + + playlist->createSavedCopy(); + playlist->removeAudioClip(Ptr::Ref( + new time_duration(0,0,0,0))); + playlist->removeAudioClip(Ptr::Ref( + new time_duration(1,0,0,0))); + CPPUNIT_ASSERT(playlist->begin() == playlist->end()); + + try { + playlist->revertToSavedCopy(); + } + catch (std::logic_error &e) { + CPPUNIT_FAIL("could not revert to saved state"); + } + + Playlist::const_iterator it = playlist->begin(); + CPPUNIT_ASSERT(it != playlist->end()); + ++it; + CPPUNIT_ASSERT(it != playlist->end()); + CPPUNIT_ASSERT(it->second->getAudioClip()->getId()->getId() == 10002); + ++it; + CPPUNIT_ASSERT(it == playlist->end()); + + playlist->deleteSavedCopy(); + try { + playlist->revertToSavedCopy(); + CPPUNIT_FAIL("allowed to revert to deleted state"); + } + catch (std::logic_error &e) { + } +} diff --git a/livesupport/modules/core/src/PlaylistTest.h b/livesupport/modules/core/src/PlaylistTest.h index e3c09d4aa..cec04972e 100644 --- a/livesupport/modules/core/src/PlaylistTest.h +++ b/livesupport/modules/core/src/PlaylistTest.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistTest.h,v $ ------------------------------------------------------------------------------*/ @@ -58,7 +58,7 @@ namespace Core { * Unit test for the UploadPlaylistMetohd class. * * @author $Author: fgerlits $ - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @see Playlist */ class PlaylistTest : public CPPUNIT_NS::TestFixture @@ -67,6 +67,7 @@ class PlaylistTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(firstTest); CPPUNIT_TEST(lockTest); CPPUNIT_TEST(audioClipTest); + CPPUNIT_TEST(savedCopyTest); CPPUNIT_TEST_SUITE_END(); private: @@ -102,6 +103,14 @@ class PlaylistTest : public CPPUNIT_NS::TestFixture void audioClipTest(void) throw (CPPUNIT_NS::Exception); + /** + * Testing the "save/revert to current state" mechanism. + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + savedCopyTest(void) throw (CPPUNIT_NS::Exception); + public: diff --git a/livesupport/products/scheduler/doc/model/SchedulerModel.zuml b/livesupport/products/scheduler/doc/model/SchedulerModel.zuml index 24be20da0..7c63756e6 100644 Binary files a/livesupport/products/scheduler/doc/model/SchedulerModel.zuml and b/livesupport/products/scheduler/doc/model/SchedulerModel.zuml differ diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx index f21125178..e286b6a75 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -145,7 +145,8 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & parameters, return; } - XmlRpcTools::playlistToXmlRpcValue(playlist, returnValue); + playlist->createSavedCopy(); + XmlRpcTools::playlistToXmlRpcValue(playlist, returnValue); return; }