jreceiver.common.rec.source
Interface Source

All Superinterfaces:
Hashable, Rec
All Known Subinterfaces:
Mexternal, Mfile, Playlist, Tune
All Known Implementing Classes:
SourceRec

public interface Source
extends Rec

An interface to be implemented by a media source.

Corresponds to Source table in JReceiver database.

Version:
$Revision: 1.6 $ $Date: 2003/04/29 00:11:51 $
Author:
Reed Esau

Field Summary
static java.lang.String DEFAULT_URL
           
static java.lang.String FORCE_PLAYLIST_URL
           
static java.lang.String HKEY_CONTENT_URL
           
static java.lang.String HKEY_DIRECT_URI
           
static java.lang.String HKEY_DST_MIME
           
static java.lang.String HKEY_DURATION
           
static java.lang.String HKEY_MIME
           
static java.lang.String HKEY_SITE_ID
           
static java.lang.String HKEY_SRC_ID
           
static java.lang.String HKEY_SRC_TYPE
           
static java.lang.String HKEY_TITLE
           
static int MAX_SRC_ID
          an upper limit for source identifiers
static int MIN_SRC_ID
          source ids must start no lower than this
static java.lang.String POPULATE_CONTENT_URL
          Populate source url with the source on the Content server.
static java.lang.String POPULATE_DIRECT_URI
          Populate source url with a direct URL to the source, bypassing the content server.
static java.lang.String POPULATE_MEXTERNAL
          populate mexternal interface of a source bean, if available
static java.lang.String POPULATE_MFILE
          populate mfile interface of a source bean, if available
static int SRCTYPE_PLAYLIST
          a playlist, stored locally as a file, generated dynamically though a database query or fetched from a remote location.
static int SRCTYPE_TUNE
          a tune, stored locally as a file, generated dynamically or streamed from a remote location.
static int SRCTYPE_UNDEFINED
           
 
Fields inherited from interface jreceiver.common.rec.Rec
HKEY_KEY, NO_LIMIT
 
Method Summary
 java.lang.String getContentSystemId()
          obtain the content server URL as a string
 java.net.URL getContentURL()
          obtain the content server URL of the source
 java.lang.String getDirectSystemId()
          Obtain the URI (as a String) of a local file source (in file:/ form) or if a remote source, a direct link to it.
 org.esau.ptarmigan.util.PtarURI getDirectURI()
          Obtain the URI of a local file source (in file:/ form) or if a remote source, a direct link to it.
 java.lang.String getDstMime()
          Obtain an ARBITRARY mime-types for the source that is consumable by a particular driver used in the construction of this source object, either through transcoding or (preferably) natively.
 int getDuration()
          Obtain the duration of the source, in seconds
 java.io.File getFile()
           
 java.lang.String getFileExtension()
           
 java.lang.String getFileName()
           
 java.lang.String getFilePath()
           
 boolean getIsLocal()
          Return true if the source refers to a local file, as indexed in the mfile table.
 boolean getIsOffsite()
          return true if the source is offsite, i.e., stored on a peer server
 boolean getIsPlaylist()
          return true if the source refers to list of tunes
 boolean getIsTune()
          return true if the source refers to a single tune
 java.lang.String getMime()
          obtain the source content-type id
 int getSiteId()
          obtain the source's location (0 if local; >0 if off-site)
 int getSrcId()
          obtain the source id
 java.lang.String getTitle()
          obtain the source name
 int getType()
          obtain the source type
 void setContentURL(java.net.URL url)
          assign the URL of the source on the content server
 void setDirectURI(org.esau.ptarmigan.util.PtarURI uri)
          assign the direct URI of the source
 void setDirectURI(java.lang.String s_uri)
          assign the direct URI of the source, absolute
 void setDuration(int duration)
          Assign the duration of the source, in seconds
 void setMime(java.lang.String mime)
          assign the source content-type id
 void setSrcId(int src_id)
          assign the source id
 void setTitle(java.lang.String title)
          assign the source name
 
Methods inherited from interface jreceiver.common.rec.Rec
getKey, setKey
 
Methods inherited from interface jreceiver.common.rec.Hashable
toHash, toString
 

Field Detail

HKEY_SRC_ID

public static final java.lang.String HKEY_SRC_ID

HKEY_TITLE

public static final java.lang.String HKEY_TITLE

HKEY_SRC_TYPE

public static final java.lang.String HKEY_SRC_TYPE

HKEY_SITE_ID

public static final java.lang.String HKEY_SITE_ID

HKEY_MIME

public static final java.lang.String HKEY_MIME

HKEY_DST_MIME

public static final java.lang.String HKEY_DST_MIME

HKEY_DURATION

public static final java.lang.String HKEY_DURATION

HKEY_DIRECT_URI

public static final java.lang.String HKEY_DIRECT_URI

HKEY_CONTENT_URL

public static final java.lang.String HKEY_CONTENT_URL

MIN_SRC_ID

public static final int MIN_SRC_ID
source ids must start no lower than this

MAX_SRC_ID

public static final int MAX_SRC_ID
an upper limit for source identifiers

POPULATE_MFILE

public static final java.lang.String POPULATE_MFILE
populate mfile interface of a source bean, if available

POPULATE_MEXTERNAL

public static final java.lang.String POPULATE_MEXTERNAL
populate mexternal interface of a source bean, if available

POPULATE_CONTENT_URL

public static final java.lang.String POPULATE_CONTENT_URL
Populate source url with the source on the Content server.

DEFAULT_URL

public static final java.lang.String DEFAULT_URL

FORCE_PLAYLIST_URL

public static final java.lang.String FORCE_PLAYLIST_URL

POPULATE_DIRECT_URI

public static final java.lang.String POPULATE_DIRECT_URI
Populate source url with a direct URL to the source, bypassing the content server.

For Mfile sources, this will be a file:/ URL.

For Mexternal (remote) sources, this will be a http:/ URL that points to something other than the JReceiver Content Server.


SRCTYPE_UNDEFINED

public static final int SRCTYPE_UNDEFINED

SRCTYPE_TUNE

public static final int SRCTYPE_TUNE
a tune, stored locally as a file, generated dynamically or streamed from a remote location.

SRCTYPE_PLAYLIST

public static final int SRCTYPE_PLAYLIST
a playlist, stored locally as a file, generated dynamically though a database query or fetched from a remote location.
Method Detail

getSrcId

public int getSrcId()
obtain the source id
Returns:
 

setSrcId

public void setSrcId(int src_id)
assign the source id

getTitle

public java.lang.String getTitle()
obtain the source name

setTitle

public void setTitle(java.lang.String title)
assign the source name

getType

public int getType()
obtain the source type

getSiteId

public int getSiteId()
obtain the source's location (0 if local; >0 if off-site)

getMime

public java.lang.String getMime()
obtain the source content-type id

setMime

public void setMime(java.lang.String mime)
assign the source content-type id

getDuration

public int getDuration()
Obtain the duration of the source, in seconds

setDuration

public void setDuration(int duration)
Assign the duration of the source, in seconds

getDstMime

public java.lang.String getDstMime()
Obtain an ARBITRARY mime-types for the source that is consumable by a particular driver used in the construction of this source object, either through transcoding or (preferably) natively.

Only valid if source is initialized for a particular driver.


getContentURL

public java.net.URL getContentURL()
obtain the content server URL of the source

If requested by a client, this URL refers to the source on the Content Server.


getContentSystemId

public java.lang.String getContentSystemId()
obtain the content server URL as a string

setContentURL

public void setContentURL(java.net.URL url)
assign the URL of the source on the content server

getDirectURI

public org.esau.ptarmigan.util.PtarURI getDirectURI()
Obtain the URI of a local file source (in file:/ form) or if a remote source, a direct link to it.

getDirectSystemId

public java.lang.String getDirectSystemId()
Obtain the URI (as a String) of a local file source (in file:/ form) or if a remote source, a direct link to it.

setDirectURI

public void setDirectURI(org.esau.ptarmigan.util.PtarURI uri)
assign the direct URI of the source

setDirectURI

public void setDirectURI(java.lang.String s_uri)
                  throws java.io.IOException,
                         java.net.MalformedURLException
assign the direct URI of the source, absolute

getFile

public java.io.File getFile()
                     throws java.io.IOException

getFilePath

public java.lang.String getFilePath()
                             throws java.io.IOException

getFileName

public java.lang.String getFileName()
                             throws java.io.IOException

getFileExtension

public java.lang.String getFileExtension()
                                  throws java.io.IOException

getIsTune

public boolean getIsTune()
return true if the source refers to a single tune

getIsPlaylist

public boolean getIsPlaylist()
return true if the source refers to list of tunes

getIsOffsite

public boolean getIsOffsite()
return true if the source is offsite, i.e., stored on a peer server

Note that this is NOT the same thing as an 'external' source, which is outside the peergroup. An example would be the BBC streaming source.


getIsLocal

public boolean getIsLocal()
Return true if the source refers to a local file, as indexed in the mfile table.


Copyright © 2001-2002 Reed Esau, All Rights Reserved.