|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jreceiver.common.rec.BaseRec | +--jreceiver.common.rec.source.SourceRec
Bean to describe a record for the Source table
Field Summary | |
protected java.net.URL |
m_content_url
The link to the resource on the JReceiver Content Server Note that the stored should be escaped to UTF-8 with %XX codes. |
protected org.esau.ptarmigan.util.PtarURI |
m_direct_uri
A direct link to the resource, either a file:/ to a local file or an http:/ direct link to a remote resouce. |
protected java.lang.String |
m_dst_mime
|
protected int |
m_duration
|
protected java.lang.String |
m_mime
|
protected int |
m_site_id
|
protected int |
m_src_id
|
protected int |
m_src_type
|
protected java.lang.String |
m_title
|
Fields inherited from interface jreceiver.common.rec.source.Source |
DEFAULT_URL, FORCE_PLAYLIST_URL, HKEY_CONTENT_URL, HKEY_DIRECT_URI, HKEY_DST_MIME, HKEY_DURATION, HKEY_MIME, HKEY_SITE_ID, HKEY_SRC_ID, HKEY_SRC_TYPE, HKEY_TITLE, MAX_SRC_ID, MIN_SRC_ID, POPULATE_CONTENT_URL, POPULATE_DIRECT_URI, POPULATE_MEXTERNAL, POPULATE_MFILE, SRCTYPE_PLAYLIST, SRCTYPE_TUNE, SRCTYPE_UNDEFINED |
Fields inherited from interface jreceiver.common.rec.Rec |
HKEY_KEY, NO_LIMIT |
Constructor Summary | |
SourceRec()
ctor - default (for use with beanutils) |
|
SourceRec(java.util.Hashtable hash)
ctor - construct from a hashtable, usually retrieved via XML-RPC |
|
SourceRec(int src_id)
ctor - minimal (for use by DeviceStatusRec creators who want to return minimal info) |
|
SourceRec(int src_id,
java.lang.String title,
int site_id,
int src_type,
java.lang.String mime,
int duration)
ctor - used to do basic initialization |
|
SourceRec(int src_id,
java.lang.String title,
int site_id,
int src_type,
java.lang.String mime,
int duration,
java.lang.String dst_mime,
org.esau.ptarmigan.util.PtarURI direct_uri,
java.net.URL content_url)
ctor - used in initializing source for a specific driver |
Method Summary | |
static SourceRec |
createInstance(java.util.Hashtable hash)
Create a SourceRec object preserved as a hash that has arrived over an XML-RPC connection or similar. |
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 URL (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 URL 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()
Obtain the short file name, without root drive or directory prefix |
java.lang.String |
getFileName()
Obtain the short file name, without root drive or directory prefix |
java.lang.String |
getFilePath()
Obtain the file path |
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.Object |
getKey()
return the Integer object that serves as this Rec's key. |
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 URI of the source |
void |
setDirectURI(java.lang.String s_encoded_uri)
assign the URI (note the 'I' not the 'L') of the source |
void |
setDuration(int duration)
Assign the duration of the source, in seconds |
void |
setKey(java.lang.Object new_key)
assign the Number-derived object that serves as this Rec's key. |
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 |
java.util.Hashtable |
toHash()
Store the object as a hash suitable for transport over an XML-RPC connection or similar. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class jreceiver.common.rec.BaseRec |
dissolve, dissolveMap, find, find, find, find |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int m_src_id
protected java.lang.String m_title
protected int m_site_id
protected int m_src_type
protected java.lang.String m_mime
protected int m_duration
protected java.lang.String m_dst_mime
protected java.net.URL m_content_url
protected org.esau.ptarmigan.util.PtarURI m_direct_uri
Constructor Detail |
public SourceRec()
public SourceRec(int src_id)
public SourceRec(int src_id, java.lang.String title, int site_id, int src_type, java.lang.String mime, int duration)
public SourceRec(int src_id, java.lang.String title, int site_id, int src_type, java.lang.String mime, int duration, java.lang.String dst_mime, org.esau.ptarmigan.util.PtarURI direct_uri, java.net.URL content_url)
public SourceRec(java.util.Hashtable hash) throws RecException
Method Detail |
public java.lang.String toString()
Hashable
toString
in interface Hashable
toString
in class java.lang.Object
public java.lang.Object getKey()
getKey
in interface Rec
public void setKey(java.lang.Object new_key)
setKey
in interface Rec
public int getSrcId()
Source
getSrcId
in interface Source
jreceiver.common.rec.source.Source
public void setSrcId(int src_id)
Source
setSrcId
in interface Source
public java.lang.String getTitle()
Source
getTitle
in interface Source
public void setTitle(java.lang.String title)
Source
setTitle
in interface Source
public int getSiteId()
Source
getSiteId
in interface Source
public int getType()
Source
getType
in interface Source
public java.lang.String getMime()
getMime
in interface Source
public void setMime(java.lang.String mime)
setMime
in interface Source
public int getDuration()
Source
getDuration
in interface Source
public void setDuration(int duration)
Source
setDuration
in interface Source
public java.lang.String getDstMime()
Source
Only valid if source is initialized for a particular driver.
getDstMime
in interface Source
public java.net.URL getContentURL()
If requested by a client, this URL refers to the source on the Content Server.
getContentURL
in interface Source
public void setContentURL(java.net.URL url)
setContentURL
in interface Source
public java.lang.String getContentSystemId()
getContentSystemId
in interface Source
public void setDirectURI(org.esau.ptarmigan.util.PtarURI uri)
setDirectURI
in interface Source
public void setDirectURI(java.lang.String s_encoded_uri) throws java.io.IOException, java.net.MalformedURLException
Typically invoked via Digester from SourceBuilder with the 'system-id' element of ptarmigan.xsd.
NOTE: as provided the system-id will be url-encoded. The SourceRec must accommodate this.
setDirectURI
in interface Source
s_encoded_uri
- A url-encoded system-id that references the source.java.io.IOException
- java.net.MalformedURLException
- public org.esau.ptarmigan.util.PtarURI getDirectURI()
getDirectURI
in interface Source
public java.lang.String getDirectSystemId()
getDirectSystemId
in interface Source
public java.io.File getFile() throws java.io.IOException
getFile
in interface Source
public java.lang.String getFilePath() throws java.io.IOException
getFilePath
in interface Source
public java.lang.String getFileName() throws java.io.IOException
getFileName
in interface Source
public java.lang.String getFileExtension() throws java.io.IOException
getFileExtension
in interface Source
public boolean getIsLocal()
Source
getIsLocal
in interface Source
public boolean getIsOffsite()
Source
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.
getIsOffsite
in interface Source
public boolean getIsTune()
Source
getIsTune
in interface Source
public boolean getIsPlaylist()
Source
getIsPlaylist
in interface Source
public java.util.Hashtable toHash()
Use SourceRec(Hashtable)
to transform the data
back into an object of this type.
toHash
in interface Hashable
public static SourceRec createInstance(java.util.Hashtable hash) throws RecException, java.net.MalformedURLException
The hash should have been created with
toHash()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |