public class Controller
extends java.lang.Object
Constructor and Description |
---|
Controller(ConfigReader config)
The constructor
|
Modifier and Type | Method and Description |
---|---|
void |
executeScriptFunction(ScriptFunction function,
java.lang.Object... args)
Used to execute a script function
|
ExtensionInfo<? extends IAction> |
getActionInfo(java.lang.String id)
Used to get information about a action
|
java.util.List<ExtensionInfo<? extends IAction>> |
getAvalibaleActions()
Used to get a list of possible actions that can be used with a media directory.
|
java.util.List<ExtensionInfo<? extends ISource>> |
getAvalibaleSources()
Used to get a list of possible sources that can be used with a media directory.
|
java.util.List<ExtensionInfo<? extends IStore>> |
getAvalibaleStores()
Used to get a list of possible stores that can be used with a media directory.
|
java.io.File |
getConfigDir()
Get the location of the media directory
|
java.util.Map<java.lang.String,DBResource> |
getDatabaseResources()
Used to get the database resources
|
ExtensionInfo<? extends ISource> |
getDefaultSource(Mode mode)
Used to get the default source information
|
java.util.Collection<java.io.File> |
getMediaDirectories()
Used to get a list of media directory locations
|
java.util.List<MediaDirectory> |
getMediaDirectories(Mode type)
Used to get a list of media directories of a given type
|
MediaDirectory |
getMediaDirectory(java.io.File mediaDir)
Used to convert a media directory location into the media directory object
|
IMediaFileInfo |
getMediaFileInformation(java.io.File file)
Used to get information on a media file
|
java.io.File |
getNativeFolder()
Used to find the native folder.
|
ISeenDatabase |
getSeenDB()
Used to get the seen media file database
|
ExtensionInfo<? extends ISource> |
getSourceInfo(java.lang.String id)
Used to get information about a source
|
ExtensionInfo<? extends IStore> |
getStoreInfo(java.lang.String id)
Used to get information about a store
|
java.util.Collection<WatchDirConfig> |
getWatchDirectories()
Used to get a list of watch directory information
|
XBMCAddonManager |
getXBMCAddonManager()
Used to get the addon manager
|
void |
init(boolean testMode)
Used to setup the controller ready for use
|
boolean |
isTestRun()
Used to find out if test mode is been used.
|
protected void |
migrateSeenEntries() |
void |
registerExtension(ExtensionInfo<?> info)
Used to register a extension.
|
void |
reloadSources()
Reload the sources, this can be used when the XBMC addons have changed
|
static void |
setXBMCAddonManager(XBMCAddonManager xbmcAddonManager)
Used to set the addon manager.
|
public Controller(ConfigReader config)
config
- The parsed configurationpublic java.util.Map<java.lang.String,DBResource> getDatabaseResources()
public void init(boolean testMode) throws ConfigException
testMode
- If true then test mode is active and no changes are to be written to diskConfigException
- Thrown if their is a problem reading the configurationpublic void executeScriptFunction(ScriptFunction function, java.lang.Object... args)
function
- The script functionargs
- The arguments to the scriptpublic void reloadSources() throws ConfigException
ConfigException
- Thrown if their is a problempublic void registerExtension(ExtensionInfo<?> info)
info
- The extension informationpublic static void setXBMCAddonManager(XBMCAddonManager xbmcAddonManager)
xbmcAddonManager
- The addon managerpublic XBMCAddonManager getXBMCAddonManager()
public MediaDirectory getMediaDirectory(java.io.File mediaDir) throws ConfigException
mediaDir
- The location of a media directoryConfigException
- Thrown if their is a problem reading the configurationpublic java.util.Collection<java.io.File> getMediaDirectories()
public java.util.Collection<WatchDirConfig> getWatchDirectories()
public ExtensionInfo<? extends ISource> getSourceInfo(java.lang.String id)
id
- The source idpublic java.util.List<ExtensionInfo<? extends ISource>> getAvalibaleSources()
public java.util.List<ExtensionInfo<? extends IStore>> getAvalibaleStores()
public java.util.List<ExtensionInfo<? extends IAction>> getAvalibaleActions()
public ExtensionInfo<? extends IStore> getStoreInfo(java.lang.String id)
id
- The store idpublic ExtensionInfo<? extends IAction> getActionInfo(java.lang.String id)
id
- The action idpublic boolean isTestRun()
public java.io.File getNativeFolder()
public java.io.File getConfigDir() throws ConfigException
ConfigException
- Thrown if their is a problempublic ExtensionInfo<? extends ISource> getDefaultSource(Mode mode) throws ConfigException
mode
- The mode to look for the source inConfigException
- Thrown if unable to find a default sourcepublic java.util.List<MediaDirectory> getMediaDirectories(Mode type) throws ConfigException
type
- The typeConfigException
- Thrown if their is a problem reading the configpublic IMediaFileInfo getMediaFileInformation(java.io.File file) throws StanwoodException
file
- The media fileIVideoFileInfo
.StanwoodException
- Thrown if their are any problemspublic ISeenDatabase getSeenDB() throws ConfigException
ConfigException
- Thrown if thier is a problem reading the databaseprotected void migrateSeenEntries() throws ConfigException, SeenDBException
ConfigException
SeenDBException