org.jmythapi.database.impl
Class DataBase

java.lang.Object
  extended by org.jmythapi.database.impl.DataBase
All Implemented Interfaces:
IDatabase

public class DataBase
extends Object
implements IDatabase

TODO: database versions are stored in: mythtv/libs/libmythtv/dbcheck.cpp


Field Summary
static String DRIVER_NAME
           
 
Fields inherited from interface org.jmythapi.database.IDatabase
DEFAULT_DB, DEFAULT_PORT, DEFAULT_USER, SETTING_HOST_ANY
 
Constructor Summary
DataBase(String dbHostName, int dbPort, String dbName, String dbUserName, String dbUserPwd)
           
 
Method Summary
 Integer addJob(JobQueue job)
           
 Integer addSchedule(Schedule schedule)
           
 boolean controlJob(Integer jobId, IJobCommand command)
           
 boolean deleteJob(Integer jobId)
           
 boolean deleteSchedule(Integer scheduleId)
           
 IRecorderChannelInfo getChannelInfo(Integer chanID)
          Gets informations about the given channel
 List<IRecorderChannelInfo> getChannelInfos()
           
 List<IRecorderChannelInfo> getChannelInfos(Integer recorderID)
           
 List<IRecorderChannelInfo> getChannelInfos(IRecorderInfo recorder)
           
 List<IRecorderChannelInfo> getChannelInfosByCallSign(String callSign)
           
 int getDbVersion()
          Gets the current database version.
 JobQueue getJob(Integer jobId)
           
 List<IJobQueue> getJobs()
           
 IRecorderInfo getRecorderForNum(Integer recorderId)
           
 List<IRecorderInfo> getRecorders()
           
 ISchedule getSchedule(Integer scheduleId)
           
 List<ISchedule> getSchedules()
           
 List<IStorageGroupDirectory> getStorageGroupDirectories()
           
 List<IStorageGroup> getStorageGroups()
           
 IGuideDataThrough queryGuideDataThrough()
           
 IMythFillDatabaseSettings queryMythFillStatus()
           
 IMythShutdownSettings queryMythShutdownStatus()
           
 IRecorderNextProgramInfo queryNextProgramInfo(IBasicChannelInfo channelInfo, Date startDateTime)
           
 IRecorderNextProgramInfo queryNextProgramInfo(Integer channelId, Date startDateTime)
           
 ISetting querySetting(String hostName, String settingName)
           
 List<ISetting> querySettings(String hostName)
           
 List<ISetting> querySettings(String hostName, String... settingsNames)
           
 Map<String,ISetting> querySettingsMap(String hostName, String... settingsNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRIVER_NAME

public static final String DRIVER_NAME
See Also:
Constant Field Values
Constructor Detail

DataBase

public DataBase(String dbHostName,
                int dbPort,
                String dbName,
                String dbUserName,
                String dbUserPwd)
         throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

getDbVersion

public int getDbVersion()
Description copied from interface: IDatabase
Gets the current database version.

Specified by:
getDbVersion in interface IDatabase
Returns:
the database version

getChannelInfo

public IRecorderChannelInfo getChannelInfo(Integer chanID)
                                    throws IOException
Description copied from interface: IDatabase
Gets informations about the given channel

Specified by:
getChannelInfo in interface IDatabase
Parameters:
chanID - the channel id
Returns:
informations about the given channel
Throws:
IOException - on communication errors

getChannelInfosByCallSign

public List<IRecorderChannelInfo> getChannelInfosByCallSign(String callSign)
                                                     throws IOException
Specified by:
getChannelInfosByCallSign in interface IDatabase
Throws:
IOException

getChannelInfos

public List<IRecorderChannelInfo> getChannelInfos()
                                           throws IOException
Specified by:
getChannelInfos in interface IDatabase
Throws:
IOException

getChannelInfos

public List<IRecorderChannelInfo> getChannelInfos(IRecorderInfo recorder)
                                           throws IOException
Specified by:
getChannelInfos in interface IDatabase
Throws:
IOException

getChannelInfos

public List<IRecorderChannelInfo> getChannelInfos(Integer recorderID)
                                           throws IOException
Specified by:
getChannelInfos in interface IDatabase
Throws:
IOException

queryGuideDataThrough

public IGuideDataThrough queryGuideDataThrough()
                                        throws IOException
Specified by:
queryGuideDataThrough in interface IDatabase
Throws:
IOException

querySetting

public ISetting querySetting(String hostName,
                             String settingName)
                      throws IOException
Specified by:
querySetting in interface IDatabase
Throws:
IOException

querySettingsMap

public Map<String,ISetting> querySettingsMap(String hostName,
                                             String... settingsNames)
                                      throws IOException
Specified by:
querySettingsMap in interface IDatabase
Throws:
IOException

querySettings

public List<ISetting> querySettings(String hostName,
                                    String... settingsNames)
                             throws IOException
Specified by:
querySettings in interface IDatabase
Throws:
IOException

querySettings

public List<ISetting> querySettings(String hostName)
                             throws IOException
Specified by:
querySettings in interface IDatabase
Throws:
IOException

queryMythFillStatus

public IMythFillDatabaseSettings queryMythFillStatus()
                                              throws IOException
Specified by:
queryMythFillStatus in interface IDatabase
Throws:
IOException

queryMythShutdownStatus

public IMythShutdownSettings queryMythShutdownStatus()
                                              throws IOException
Specified by:
queryMythShutdownStatus in interface IDatabase
Throws:
IOException

getRecorderForNum

public IRecorderInfo getRecorderForNum(Integer recorderId)
                                throws IOException
Specified by:
getRecorderForNum in interface IDatabase
Throws:
IOException

getRecorders

public List<IRecorderInfo> getRecorders()
                                 throws IOException
Specified by:
getRecorders in interface IDatabase
Throws:
IOException

queryNextProgramInfo

public IRecorderNextProgramInfo queryNextProgramInfo(IBasicChannelInfo channelInfo,
                                                     Date startDateTime)
                                              throws IOException
Specified by:
queryNextProgramInfo in interface IDatabase
Throws:
IOException

queryNextProgramInfo

public IRecorderNextProgramInfo queryNextProgramInfo(Integer channelId,
                                                     Date startDateTime)
                                              throws IOException
Specified by:
queryNextProgramInfo in interface IDatabase
Throws:
IOException

getStorageGroupDirectories

public List<IStorageGroupDirectory> getStorageGroupDirectories()
                                                        throws IOException
Specified by:
getStorageGroupDirectories in interface IDatabase
Throws:
IOException

getStorageGroups

public List<IStorageGroup> getStorageGroups()
                                     throws IOException
Specified by:
getStorageGroups in interface IDatabase
Throws:
IOException

getJobs

public List<IJobQueue> getJobs()
                        throws IOException
Specified by:
getJobs in interface IDatabase
Throws:
IOException

getJob

public JobQueue getJob(Integer jobId)
                throws IOException
Specified by:
getJob in interface IDatabase
Throws:
IOException

addJob

public Integer addJob(JobQueue job)
               throws IOException
Specified by:
addJob in interface IDatabase
Throws:
IOException

deleteJob

public boolean deleteJob(Integer jobId)
                  throws IOException
Specified by:
deleteJob in interface IDatabase
Throws:
IOException

controlJob

public boolean controlJob(Integer jobId,
                          IJobCommand command)
                   throws IOException
Specified by:
controlJob in interface IDatabase
Throws:
IOException

getSchedules

public List<ISchedule> getSchedules()
                             throws IOException
Specified by:
getSchedules in interface IDatabase
Throws:
IOException

getSchedule

public ISchedule getSchedule(Integer scheduleId)
                      throws IOException
Specified by:
getSchedule in interface IDatabase
Throws:
IOException

addSchedule

public Integer addSchedule(Schedule schedule)
                    throws IOException
Specified by:
addSchedule in interface IDatabase
Throws:
IOException

deleteSchedule

public boolean deleteSchedule(Integer scheduleId)
                       throws IOException
Specified by:
deleteSchedule in interface IDatabase
Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.