jreceiver.common.rec.driver
Class DriverRec

java.lang.Object
  |
  +--jreceiver.common.rec.BaseRec
        |
        +--jreceiver.common.rec.driver.DriverRec
All Implemented Interfaces:
Driver, Hashable, Rec

public class DriverRec
extends BaseRec
implements Driver

A record from the Driver table

Version:
$Revision: 1.3 $ $Date: 2002/09/30 08:56:27 $
Author:
Reed Esau

Field Summary
protected  java.lang.String m_callback_password
           
protected  java.net.URL m_callback_url
           
protected  java.lang.String m_callback_user_id
           
protected  java.util.Vector m_commands
           
protected  java.util.Vector m_devices
           
protected  int m_id
           
protected  boolean m_is_active
           
protected  int m_master_mask
           
protected  int m_mime_mask
           
protected  boolean m_per_user_settings
           
protected  int m_slave_mask
           
protected  boolean m_supports_device_status
           
protected  java.lang.String m_user_id
           
 
Fields inherited from interface jreceiver.common.rec.driver.Driver
HKEY_CALLBACK_PASSWORD, HKEY_CALLBACK_URL, HKEY_CALLBACK_USER_ID, HKEY_COMMANDS, HKEY_DEVICES, HKEY_DRIVER_ID, HKEY_IS_ACTIVE, HKEY_MASTER_MASK, HKEY_MIME_MASK, HKEY_PER_USER_SETTINGS, HKEY_SLAVE_MASK, HKEY_SUPPORTS_DEVICE_STATUS, HKEY_USER_ID, POPULATE_COMMANDLIST, POPULATE_DEVICELIST, POPULATE_DEVICESTATUSLIST
 
Fields inherited from interface jreceiver.common.rec.Rec
HKEY_KEY, NO_LIMIT
 
Constructor Summary
DriverRec()
          ctor - default
DriverRec(java.util.Hashtable hash)
          ctor - via xml-rpc or similar
DriverRec(int id, java.lang.String user_id)
          ctor - very shallow
DriverRec(int id, java.lang.String user_id, java.net.URL callback_url, java.lang.String callback_user_id, java.lang.String callback_password, int mime_mask, int master_mask, int slave_mask, boolean per_user_settings, boolean supports_device_status, boolean is_active)
          ctor - shallow
DriverRec(int id, java.lang.String user_id, java.net.URL callback_url, java.lang.String callback_user_id, java.lang.String callback_password, int mime_mask, int master_mask, int slave_mask, boolean per_user_settings, boolean supports_device_status, boolean is_active, java.util.Vector devices, java.util.Vector commands)
          ctor - deep, with device list
 
Method Summary
 java.lang.String getCallbackPassword()
          obtain the driver-supplied password for the driver's callback interface
 java.net.URL getCallbackUrl()
          obtain the callback_url for the driver's callback interface (presently xml-rpc)
 java.lang.String getCallbackUserId()
          obtain the driver-supplied user_id for the driver's callback interface
 java.util.Vector getCommands()
          obtain the list of commands the driver is presently serving
 java.lang.String getDescription()
          obtain a derived description of a driver instance
 java.util.Vector getDevices()
          obtain the list of devices the driver is presently serving
 int getId()
          obtain the unique id of the driver
 boolean getIsActive()
          has the driver been freshly registered since server start?
 java.lang.Object getKey()
          return the Integer or Key object that serves as this Rec's key.
 int getMasterMask()
          obtain the list of supported command master types, stored as master_ids in mask
 int getMimeMask()
          obtain the list of supported mime types, stored as mime_ids in mask
 boolean getPerUserSettings()
          If true, the driver settings are not tied to the user credentials with which it was registered.
 int getSlaveMask()
          obtain the list of supported command slave types, stored as slave_ids in mask
 boolean getSupportsDeviceStatus()
           
 java.lang.String getUserId()
          obtain the user_id of the driver
static java.util.Vector reconstitute(java.util.Vector vector)
          Reconstitute each DriverRec object that appears as a hash in the list.
 void setCallbackPassword(java.lang.String password)
          assign the driver-supplied user_id for the driver's callback interface
 void setCallbackUserId(java.lang.String user_id)
          assign the driver-supplied user_id for the driver's callback interface
 void setCommands(java.util.Vector commands)
          assign a list of all Commands the driver supports for its devices
 void setDevices(java.util.Vector devices)
          assign a list of all Devices the driver is presently serving
 void setIsActive(boolean flag)
          set whether the driver has been freshly registered since server start
 void setKey(java.lang.Object new_key)
          assign the Number-derived, Key-derived or String that serves as this Rec's key.
 void setMasterMask(int master_mask)
          assign a mask describing all the support master types
 void setMimeMask(int mime_mask)
          assign a mask describing all the support mime types
 void setPerUserSettings(boolean per_user_settings)
          If true, the driver settings are not tied to the user credentials with which it was registered.
 void setSlaveMask(int slave_mask)
          assign a mask describing all the support slave types
 void setSupportsDeviceStatus(boolean supports_device_status)
           
 void setUserId(java.lang.String user_id)
          assign the user_id of the driver
 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.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

m_id

protected int m_id

m_user_id

protected java.lang.String m_user_id

m_callback_url

protected java.net.URL m_callback_url

m_callback_user_id

protected java.lang.String m_callback_user_id

m_callback_password

protected java.lang.String m_callback_password

m_mime_mask

protected int m_mime_mask

m_master_mask

protected int m_master_mask

m_slave_mask

protected int m_slave_mask

m_per_user_settings

protected boolean m_per_user_settings

m_supports_device_status

protected boolean m_supports_device_status

m_is_active

protected boolean m_is_active

m_devices

protected java.util.Vector m_devices

m_commands

protected java.util.Vector m_commands
Constructor Detail

DriverRec

public DriverRec()
ctor - default

DriverRec

public DriverRec(int id,
                 java.lang.String user_id)
ctor - very shallow

DriverRec

public DriverRec(int id,
                 java.lang.String user_id,
                 java.net.URL callback_url,
                 java.lang.String callback_user_id,
                 java.lang.String callback_password,
                 int mime_mask,
                 int master_mask,
                 int slave_mask,
                 boolean per_user_settings,
                 boolean supports_device_status,
                 boolean is_active)
ctor - shallow

DriverRec

public DriverRec(int id,
                 java.lang.String user_id,
                 java.net.URL callback_url,
                 java.lang.String callback_user_id,
                 java.lang.String callback_password,
                 int mime_mask,
                 int master_mask,
                 int slave_mask,
                 boolean per_user_settings,
                 boolean supports_device_status,
                 boolean is_active,
                 java.util.Vector devices,
                 java.util.Vector commands)
ctor - deep, with device list

DriverRec

public DriverRec(java.util.Hashtable hash)
          throws RecException
ctor - via xml-rpc or similar

If a list of devices is provided, attempt to include their status information by creating them as DeviceStatusRecs.

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 DriverRec(Hashtable) to transform the data back into an object of this type.

Specified by:
toHash in interface Hashable
Returns:
 

toString

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

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

getKey

public java.lang.Object getKey()
return the Integer or Key object that serves as this Rec's key.
Specified by:
getKey in interface Rec

setKey

public void setKey(java.lang.Object new_key)
assign the Number-derived, Key-derived or String that serves as this Rec's key.
Specified by:
setKey in interface Rec

getId

public int getId()
obtain the unique id of the driver
Specified by:
getId in interface Driver

getUserId

public java.lang.String getUserId()
obtain the user_id of the driver
Specified by:
getUserId in interface Driver

setUserId

public void setUserId(java.lang.String user_id)
assign the user_id of the driver
Specified by:
setUserId in interface Driver

getCallbackUrl

public java.net.URL getCallbackUrl()
obtain the callback_url for the driver's callback interface (presently xml-rpc)
Specified by:
getCallbackUrl in interface Driver

getCallbackUserId

public java.lang.String getCallbackUserId()
obtain the driver-supplied user_id for the driver's callback interface
Specified by:
getCallbackUserId in interface Driver

setCallbackUserId

public void setCallbackUserId(java.lang.String user_id)
assign the driver-supplied user_id for the driver's callback interface
Specified by:
setCallbackUserId in interface Driver

getCallbackPassword

public java.lang.String getCallbackPassword()
obtain the driver-supplied password for the driver's callback interface
Specified by:
getCallbackPassword in interface Driver

setCallbackPassword

public void setCallbackPassword(java.lang.String password)
assign the driver-supplied user_id for the driver's callback interface
Specified by:
setCallbackPassword in interface Driver

getMimeMask

public int getMimeMask()
obtain the list of supported mime types, stored as mime_ids in mask
Specified by:
getMimeMask in interface Driver

setMimeMask

public void setMimeMask(int mime_mask)
assign a mask describing all the support mime types

See Mime for a list of the constants.

Specified by:
setMimeMask in interface Driver

getMasterMask

public int getMasterMask()
obtain the list of supported command master types, stored as master_ids in mask
Specified by:
getMasterMask in interface Driver

setMasterMask

public void setMasterMask(int master_mask)
assign a mask describing all the support master types
Specified by:
setMasterMask in interface Driver

getSlaveMask

public int getSlaveMask()
obtain the list of supported command slave types, stored as slave_ids in mask
Specified by:
getSlaveMask in interface Driver

setSlaveMask

public void setSlaveMask(int slave_mask)
assign a mask describing all the support slave types
Specified by:
setSlaveMask in interface Driver

getPerUserSettings

public boolean getPerUserSettings()
If true, the driver settings are not tied to the user credentials with which it was registered.
Specified by:
getPerUserSettings in interface Driver

setPerUserSettings

public void setPerUserSettings(boolean per_user_settings)
If true, the driver settings are not tied to the user credentials with which it was registered.
Specified by:
setPerUserSettings in interface Driver

getSupportsDeviceStatus

public boolean getSupportsDeviceStatus()
Specified by:
getSupportsDeviceStatus in interface Driver

setSupportsDeviceStatus

public void setSupportsDeviceStatus(boolean supports_device_status)
Specified by:
setSupportsDeviceStatus in interface Driver

getIsActive

public boolean getIsActive()
has the driver been freshly registered since server start?
Specified by:
getIsActive in interface Driver

setIsActive

public void setIsActive(boolean flag)
set whether the driver has been freshly registered since server start
Specified by:
setIsActive in interface Driver

getDevices

public java.util.Vector getDevices()
obtain the list of devices the driver is presently serving
Specified by:
getDevices in interface Driver

setDevices

public void setDevices(java.util.Vector devices)
assign a list of all Devices the driver is presently serving
Specified by:
setDevices in interface Driver

getCommands

public java.util.Vector getCommands()
obtain the list of commands the driver is presently serving
Specified by:
getCommands in interface Driver

setCommands

public void setCommands(java.util.Vector commands)
assign a list of all Commands the driver supports for its devices
Specified by:
setCommands in interface Driver

getDescription

public java.lang.String getDescription()
obtain a derived description of a driver instance
Specified by:
getDescription in interface Driver

reconstitute

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


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