jreceiver.common.callback.rec
Class DeviceStatusRec

java.lang.Object
  |
  +--jreceiver.common.rec.BaseRec
        |
        +--jreceiver.common.rec.driver.DeviceRec
              |
              +--jreceiver.common.callback.rec.DeviceStatusRec
All Implemented Interfaces:
Device, DeviceStatus, Hashable, Rec

public class DeviceStatusRec
extends DeviceRec
implements DeviceStatus

Details for a device provided by a driver.

Version:
$Revision: 1.5 $ $Date: 2002/07/20 01:40:43 $
Author:
Reed Esau

Field Summary
protected  java.lang.String mac_address
           
protected  int play_state
           
protected  Source source
           
protected  long timecode
           
 
Fields inherited from class jreceiver.common.rec.driver.DeviceRec
address, device_id, driver_id, timestamp
 
Fields inherited from interface jreceiver.common.callback.rec.DeviceStatus
HKEY_MAC_ADDRESS, HKEY_PLAY_STATE, HKEY_SOURCE, HKEY_TIMECODE, PLAY_STATE_OFF, PLAY_STATE_PAUSED, PLAY_STATE_PAUSED_OR_STOPPED, PLAY_STATE_PLAYING, PLAY_STATE_STOPPED, PLAY_STATE_UNKNOWN
 
Fields inherited from interface jreceiver.common.rec.driver.Device
HKEY_ADDRESS, HKEY_DEVICE_ID, HKEY_DRIVER_ID, HKEY_TIMESTAMP
 
Fields inherited from interface jreceiver.common.rec.Rec
HKEY_KEY, NO_LIMIT
 
Constructor Summary
DeviceStatusRec(java.util.Hashtable hash)
          ctor - construct from a hashtable, usually retrieved via XML-RPC
DeviceStatusRec(int device_id, int driver_id, java.lang.String address, long timestamp, java.lang.String mac_address, int play_state, Source source, long timecode)
          ctor
 
Method Summary
 java.lang.String getMacAddress()
          This address is a unique network card address by which to identify the receiver.
 int getPlayState()
          The play state is one of the play state constants
 java.lang.String getPlayStateMessage()
          The play_state is a message_id (you'll have to translate via message.properties)
 Source getSource()
          This corresponds to a media source.
 long getTimecode()
          This is the approximate number of MILLISECONDS into the current song.
 long getTimecodeInSeconds()
          This is the approximate number of SECONDS into the current song.
static java.util.Vector reconstitute(java.util.Vector vector)
          Reconstitute each DeviceStatusRec object that appears as a hash in the list.
 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 event.
 
Methods inherited from class jreceiver.common.rec.driver.DeviceRec
getAddress, getDriverId, getId, getKey, getTimestamp, setKey
 
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
 
Methods inherited from interface jreceiver.common.rec.driver.Device
getAddress, getDriverId, getId, getTimestamp
 
Methods inherited from interface jreceiver.common.rec.Rec
getKey, setKey
 

Field Detail

timecode

protected long timecode

mac_address

protected java.lang.String mac_address

play_state

protected int play_state

source

protected Source source
Constructor Detail

DeviceStatusRec

public DeviceStatusRec(int device_id,
                       int driver_id,
                       java.lang.String address,
                       long timestamp,
                       java.lang.String mac_address,
                       int play_state,
                       Source source,
                       long timecode)
ctor

DeviceStatusRec

public DeviceStatusRec(java.util.Hashtable hash)
                throws RecException
ctor - construct from a hashtable, usually retrieved via XML-RPC
Method Detail

toHash

public java.util.Hashtable toHash()
Store the object as a hash suitable for transport over an XML-RPC connection or similar.

Use DeviceStatusRec(Hashtable) to transform the data back into an object of this type.

Specified by:
toHash in interface Hashable
Overrides:
toHash in class DeviceRec
Returns:
 

toString

public java.lang.String toString()
Returns a string representation of the event.

Specified by:
toString in interface Hashable
Overrides:
toString in class DeviceRec
Returns:
a string representation of the object.

getTimecode

public long getTimecode()
This is the approximate number of MILLISECONDS into the current song.
Specified by:
getTimecode in interface DeviceStatus

getTimecodeInSeconds

public long getTimecodeInSeconds()
This is the approximate number of SECONDS into the current song.
Specified by:
getTimecodeInSeconds in interface DeviceStatus

getMacAddress

public java.lang.String getMacAddress()
This address is a unique network card address by which to identify the receiver.
Specified by:
getMacAddress in interface DeviceStatus

getPlayState

public int getPlayState()
The play state is one of the play state constants
Specified by:
getPlayState in interface DeviceStatus

getPlayStateMessage

public java.lang.String getPlayStateMessage()
The play_state is a message_id (you'll have to translate via message.properties)

getSource

public Source getSource()
This corresponds to a media source. If src_id!=0 it refers to a source in the JRec database.
Specified by:
getSource in interface DeviceStatus

reconstitute

public static java.util.Vector reconstitute(java.util.Vector vector)
                                     throws RecException
Reconstitute each DeviceStatusRec object that appears as a hash in the list.


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