com.aelitis.azureus.core.devices.impl
Class DeviceManagerImpl

java.lang.Object
  extended by com.aelitis.azureus.core.devices.impl.DeviceManagerImpl
All Implemented Interfaces:
DeviceManager, DeviceOfflineDownloaderManager, AEDiagnosticsEvidenceGenerator, PowerManagementListener

public class DeviceManagerImpl
extends java.lang.Object
implements DeviceManager, DeviceOfflineDownloaderManager, PowerManagementListener, AEDiagnosticsEvidenceGenerator


Nested Class Summary
protected static class DeviceManagerImpl.DeviceManufacturerImpl
           
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.core.devices.DeviceManager
DeviceManager.DeviceManufacturer, DeviceManager.UnassociatedDevice
 
Field Summary
protected static int DEVICE_AUTO_HIDE_CHECK_PERIOD
           
protected static int DEVICE_AUTO_HIDE_CHECK_TICKS
           
protected static int DEVICE_UPDATE_PERIOD
           
 
Fields inherited from interface com.aelitis.azureus.core.devices.DeviceManager
CONFIG_VIEW_HIDE_REND_GENERIC, CONFIG_VIEW_SHOW_ONLY_TAGGED
 
Fields inherited from interface org.gudy.azureus2.plugins.utils.PowerManagementListener
ST_SLEEP
 
Constructor Summary
protected DeviceManagerImpl()
           
 
Method Summary
protected  DeviceImpl addDevice(DeviceImpl device)
           
protected  DeviceImpl addDevice(DeviceImpl device, boolean is_alive)
           
 void addDiscoveryListener(DeviceManagerDiscoveryListener listener)
           
 Device addInetDevice(int type, java.lang.String uid, java.lang.String classification, java.lang.String name, java.net.InetAddress address)
           
 void addListener(DeviceManagerListener listener)
           
 void addManualDownloads(Download[] downloads)
           
 Device addVirtualDevice(int type, java.lang.String uid, java.lang.String classification, java.lang.String name)
           
protected  void applyUpdates(DeviceImpl device)
           
protected  boolean browseReceived(TrackerWebPageRequest request, java.util.Map<java.lang.String,java.lang.Object> browser_args)
           
protected  void configDirty()
           
protected  void configDirty(DeviceImpl device, boolean save_changes)
           
protected  Device createDevice(int device_type, java.lang.String uid, java.lang.String classification, java.lang.String name, boolean manual)
           
protected  void deviceAdded(DeviceImpl device)
           
protected  void deviceChanged(DeviceImpl device, boolean save_changes)
           
protected  void deviceRemoved(DeviceImpl device)
           
protected  VuzeFile exportVuzeFile(DeviceImpl device)
           
 Device findDevice(UPnPDevice upnpDevice)
           
 void generate(IndentWriter writer)
           
 int getAutoHideOldDevicesDays()
           
 boolean getAutoSearch()
           
protected  AzureusCore getAzureusCore()
           
 java.io.File getDefaultWorkingDirectory()
           
 java.io.File getDefaultWorkingDirectory(boolean persist)
           
protected  DeviceImpl getDevice(java.lang.String id)
           
 DeviceManager.DeviceManufacturer[] getDeviceManufacturers(int device_type)
           
 DeviceImpl[] getDevices()
           
 DeviceTemplate[] getDeviceTemplates(int device_type)
           
 boolean getDisableSleep()
           
 java.lang.String getLocalServiceName()
           
protected  AEDiagnosticsLogger getLogger()
           
protected  java.lang.String getMimeType(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file)
           
 DeviceOfflineDownloaderManager getOfflineDownlaoderManager()
           
 boolean getOfflineDownloadingIncludePrivate()
           
 boolean getOfflineDownloadingIsAuto()
           
 java.lang.String getPowerName()
           
 TranscodeProvider[] getProviders()
           
 java.lang.String getRSSLink()
           
static DeviceManager getSingleton()
           
protected  java.net.URL getStreamURL(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file, java.lang.String host)
           
 TranscodeManagerImpl getTranscodeManager()
           
 DeviceManager.UnassociatedDevice[] getUnassociatedDevices()
           
protected  DeviceManagerUPnPImpl getUPnPManager()
           
 void informPowerStateChange(int new_state, java.lang.Object data)
           
 boolean isBusy(int device_type)
           
protected  boolean isClosing()
           
protected  boolean isExplicitSearch()
           
 boolean isManualDownload(Download download)
           
 boolean isOfflineDownloadingEnabled()
           
 boolean isRSSPublishEnabled()
           
 boolean isTiVoEnabled()
           
protected  void loadConfig()
           
 void log(java.lang.String s)
           
 void log(java.lang.String s, java.lang.Throwable e)
           
protected  void manageOD()
           
static void preInitialise()
           
protected  void removeDevice(DeviceImpl device)
           
 void removeDiscoveryListener(DeviceManagerDiscoveryListener listener)
           
 void removeListener(DeviceManagerListener listener)
           
 void removeManualDownloads(Download[] downloads)
           
protected  void requestAttention(DeviceImpl device)
           
 boolean requestPowerStateChange(int new_state, java.lang.Object data)
           
protected  void saveConfig()
           
 void search(int millis, DeviceSearchListener listener)
           
 void setAutoHideOldDevicesDays(int days)
           
 void setAutoSearch(boolean auto)
           
 void setDefaultWorkingDirectory(java.io.File dir)
           
 void setDisableSleep(boolean b)
           
 void setOfflineDownloadingEnabled(boolean enabled)
           
 void setOfflineDownloadingIncludePrivate(boolean include)
           
 void setOfflineDownloadingIsAuto(boolean auto)
           
 void setRSSPublishEnabled(boolean enabled)
           
 void setTiVoEnabled(boolean enabled)
           
protected  void UPnPManagerStarted()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEVICE_UPDATE_PERIOD

protected static final int DEVICE_UPDATE_PERIOD
See Also:
Constant Field Values

DEVICE_AUTO_HIDE_CHECK_PERIOD

protected static final int DEVICE_AUTO_HIDE_CHECK_PERIOD
See Also:
Constant Field Values

DEVICE_AUTO_HIDE_CHECK_TICKS

protected static final int DEVICE_AUTO_HIDE_CHECK_TICKS
See Also:
Constant Field Values
Constructor Detail

DeviceManagerImpl

protected DeviceManagerImpl()
Method Detail

preInitialise

public static void preInitialise()

getSingleton

public static DeviceManager getSingleton()

manageOD

protected void manageOD()

UPnPManagerStarted

protected void UPnPManagerStarted()

getAzureusCore

protected AzureusCore getAzureusCore()

getUPnPManager

protected DeviceManagerUPnPImpl getUPnPManager()

getLocalServiceName

public java.lang.String getLocalServiceName()
Specified by:
getLocalServiceName in interface DeviceManager

isTiVoEnabled

public boolean isTiVoEnabled()
Specified by:
isTiVoEnabled in interface DeviceManager

setTiVoEnabled

public void setTiVoEnabled(boolean enabled)
Specified by:
setTiVoEnabled in interface DeviceManager

getProviders

public TranscodeProvider[] getProviders()

getDeviceTemplates

public DeviceTemplate[] getDeviceTemplates(int device_type)
Specified by:
getDeviceTemplates in interface DeviceManager

getDeviceManufacturers

public DeviceManager.DeviceManufacturer[] getDeviceManufacturers(int device_type)
Specified by:
getDeviceManufacturers in interface DeviceManager

addVirtualDevice

public Device addVirtualDevice(int type,
                               java.lang.String uid,
                               java.lang.String classification,
                               java.lang.String name)
                        throws DeviceManagerException
Specified by:
addVirtualDevice in interface DeviceManager
Throws:
DeviceManagerException

addInetDevice

public Device addInetDevice(int type,
                            java.lang.String uid,
                            java.lang.String classification,
                            java.lang.String name,
                            java.net.InetAddress address)
                     throws DeviceManagerException
Specified by:
addInetDevice in interface DeviceManager
Throws:
DeviceManagerException

createDevice

protected Device createDevice(int device_type,
                              java.lang.String uid,
                              java.lang.String classification,
                              java.lang.String name,
                              boolean manual)
                       throws DeviceManagerException
Throws:
DeviceManagerException

search

public void search(int millis,
                   DeviceSearchListener listener)
Specified by:
search in interface DeviceManager

getDevice

protected DeviceImpl getDevice(java.lang.String id)

addDevice

protected DeviceImpl addDevice(DeviceImpl device)

addDevice

protected DeviceImpl addDevice(DeviceImpl device,
                               boolean is_alive)

applyUpdates

protected void applyUpdates(DeviceImpl device)

removeDevice

protected void removeDevice(DeviceImpl device)

isBusy

public boolean isBusy(int device_type)
Specified by:
isBusy in interface DeviceManager

getDevices

public DeviceImpl[] getDevices()
Specified by:
getDevices in interface DeviceManager

getAutoSearch

public boolean getAutoSearch()
Specified by:
getAutoSearch in interface DeviceManager

setAutoSearch

public void setAutoSearch(boolean auto)
Specified by:
setAutoSearch in interface DeviceManager

getAutoHideOldDevicesDays

public int getAutoHideOldDevicesDays()
Specified by:
getAutoHideOldDevicesDays in interface DeviceManager

setAutoHideOldDevicesDays

public void setAutoHideOldDevicesDays(int days)
Specified by:
setAutoHideOldDevicesDays in interface DeviceManager

isRSSPublishEnabled

public boolean isRSSPublishEnabled()
Specified by:
isRSSPublishEnabled in interface DeviceManager

setRSSPublishEnabled

public void setRSSPublishEnabled(boolean enabled)
Specified by:
setRSSPublishEnabled in interface DeviceManager

getRSSLink

public java.lang.String getRSSLink()
Specified by:
getRSSLink in interface DeviceManager

getOfflineDownlaoderManager

public DeviceOfflineDownloaderManager getOfflineDownlaoderManager()
Specified by:
getOfflineDownlaoderManager in interface DeviceManager

isOfflineDownloadingEnabled

public boolean isOfflineDownloadingEnabled()
Specified by:
isOfflineDownloadingEnabled in interface DeviceOfflineDownloaderManager

setOfflineDownloadingEnabled

public void setOfflineDownloadingEnabled(boolean enabled)
Specified by:
setOfflineDownloadingEnabled in interface DeviceOfflineDownloaderManager

getOfflineDownloadingIsAuto

public boolean getOfflineDownloadingIsAuto()
Specified by:
getOfflineDownloadingIsAuto in interface DeviceOfflineDownloaderManager

setOfflineDownloadingIsAuto

public void setOfflineDownloadingIsAuto(boolean auto)
Specified by:
setOfflineDownloadingIsAuto in interface DeviceOfflineDownloaderManager

getOfflineDownloadingIncludePrivate

public boolean getOfflineDownloadingIncludePrivate()
Specified by:
getOfflineDownloadingIncludePrivate in interface DeviceOfflineDownloaderManager

setOfflineDownloadingIncludePrivate

public void setOfflineDownloadingIncludePrivate(boolean include)
Specified by:
setOfflineDownloadingIncludePrivate in interface DeviceOfflineDownloaderManager

isManualDownload

public boolean isManualDownload(Download download)
Specified by:
isManualDownload in interface DeviceOfflineDownloaderManager

addManualDownloads

public void addManualDownloads(Download[] downloads)
Specified by:
addManualDownloads in interface DeviceOfflineDownloaderManager

removeManualDownloads

public void removeManualDownloads(Download[] downloads)
Specified by:
removeManualDownloads in interface DeviceOfflineDownloaderManager

isExplicitSearch

protected boolean isExplicitSearch()

isClosing

protected boolean isClosing()

loadConfig

protected void loadConfig()

configDirty

protected void configDirty(DeviceImpl device,
                           boolean save_changes)

configDirty

protected void configDirty()

saveConfig

protected void saveConfig()

deviceAdded

protected void deviceAdded(DeviceImpl device)

deviceChanged

protected void deviceChanged(DeviceImpl device,
                             boolean save_changes)

deviceRemoved

protected void deviceRemoved(DeviceImpl device)

requestAttention

protected void requestAttention(DeviceImpl device)

getStreamURL

protected java.net.URL getStreamURL(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file,
                                    java.lang.String host)

getMimeType

protected java.lang.String getMimeType(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file)

getDefaultWorkingDirectory

public java.io.File getDefaultWorkingDirectory()
Specified by:
getDefaultWorkingDirectory in interface DeviceManager

getDefaultWorkingDirectory

public java.io.File getDefaultWorkingDirectory(boolean persist)

setDefaultWorkingDirectory

public void setDefaultWorkingDirectory(java.io.File dir)
Specified by:
setDefaultWorkingDirectory in interface DeviceManager

getDisableSleep

public boolean getDisableSleep()
Specified by:
getDisableSleep in interface DeviceManager

setDisableSleep

public void setDisableSleep(boolean b)
Specified by:
setDisableSleep in interface DeviceManager

getTranscodeManager

public TranscodeManagerImpl getTranscodeManager()
Specified by:
getTranscodeManager in interface DeviceManager

getUnassociatedDevices

public DeviceManager.UnassociatedDevice[] getUnassociatedDevices()
Specified by:
getUnassociatedDevices in interface DeviceManager

getPowerName

public java.lang.String getPowerName()
Specified by:
getPowerName in interface PowerManagementListener

requestPowerStateChange

public boolean requestPowerStateChange(int new_state,
                                       java.lang.Object data)
Specified by:
requestPowerStateChange in interface PowerManagementListener

informPowerStateChange

public void informPowerStateChange(int new_state,
                                   java.lang.Object data)
Specified by:
informPowerStateChange in interface PowerManagementListener

addListener

public void addListener(DeviceManagerListener listener)
Specified by:
addListener in interface DeviceManager

browseReceived

protected boolean browseReceived(TrackerWebPageRequest request,
                                 java.util.Map<java.lang.String,java.lang.Object> browser_args)

exportVuzeFile

protected VuzeFile exportVuzeFile(DeviceImpl device)
                           throws java.io.IOException
Throws:
java.io.IOException

addDiscoveryListener

public void addDiscoveryListener(DeviceManagerDiscoveryListener listener)
Specified by:
addDiscoveryListener in interface DeviceManager

removeDiscoveryListener

public void removeDiscoveryListener(DeviceManagerDiscoveryListener listener)
Specified by:
removeDiscoveryListener in interface DeviceManager

removeListener

public void removeListener(DeviceManagerListener listener)
Specified by:
removeListener in interface DeviceManager

findDevice

public Device findDevice(UPnPDevice upnpDevice)
Specified by:
findDevice in interface DeviceManager
Returns:

getLogger

protected AEDiagnosticsLogger getLogger()

log

public void log(java.lang.String s,
                java.lang.Throwable e)

log

public void log(java.lang.String s)

generate

public void generate(IndentWriter writer)
Specified by:
generate in interface AEDiagnosticsEvidenceGenerator