Package com.biglybt.core.devices.impl
Class DeviceManagerImpl
java.lang.Object
com.biglybt.core.devices.impl.DeviceManagerImpl
- All Implemented Interfaces:
DeviceManager
,AEDiagnosticsEvidenceGenerator
,PowerManagementListener
public class DeviceManagerImpl
extends Object
implements DeviceManager, PowerManagementListener, AEDiagnosticsEvidenceGenerator
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.biglybt.core.devices.DeviceManager
DeviceManager.DeviceManufacturer, DeviceManager.UnassociatedDevice
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
(package private) int
private static final int
(package private) boolean
private static final String
(package private) boolean
private static final String
(package private) boolean
private static final String
private static final String
(package private) boolean
private Core
protected static final int
protected static final int
(package private) List<DeviceImpl>
private Map<String,
DeviceImpl> protected static final int
(package private) DeviceDriveManager
(package private) int
private int
private AESemaphore
private boolean
private ListenerManager<DeviceManagerListener>
private String
private AEDiagnosticsLogger
private Object
private static final String
private Object
private static final int
private static final int
private static final int
private static final int
private static final int
private static final String
private static final String
private static final String
private TorrentAttribute
private static boolean
private static final String
private DeviceManagerRSSFeed
private static DeviceManagerImpl
(package private) DeviceTivoManager
private static final String
(package private) TranscodeManagerImpl
(package private) DeviceManagerUPnPImpl
Fields inherited from interface com.biglybt.core.devices.DeviceManager
CONFIG_VIEW_HIDE_REND_GENERIC, CONFIG_VIEW_SHOW_ONLY_TAGGED
Fields inherited from interface com.biglybt.pif.utils.PowerManagementListener
ST_SLEEP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DeviceImpl
addDevice
(DeviceImpl device) protected DeviceImpl
addDevice
(DeviceImpl device, boolean is_alive) void
addInetDevice
(int type, String uid, String classification, String name, InetAddress address) void
addListener
(DeviceManagerListener listener) addVirtualDevice
(int type, String uid, String classification, String name) protected void
applyUpdates
(DeviceImpl device) protected boolean
browseReceived
(TrackerWebPageRequest request, Map<String, Object> browser_args) protected void
protected void
configDirty
(DeviceImpl device, boolean save_changes) protected Device
createDevice
(int device_type, String uid, String classification, String name, boolean manual) protected void
deviceAdded
(DeviceImpl device) protected void
deviceChanged
(DeviceImpl device, boolean save_changes) protected void
deviceRemoved
(DeviceImpl device) private TranscodeManager
ensureInitialised
(boolean partial) protected VuzeFile
exportVuzeFile
(DeviceImpl device) findDevice
(UPnPDevice upnpDevice) void
generate
(IndentWriter writer) int
boolean
protected Core
getCore()
getDefaultWorkingDirectory
(boolean persist) protected DeviceImpl
getDeviceManufacturers
(int device_type) getDeviceTemplates
(int device_type) boolean
protected AEDiagnosticsLogger
protected String
getMimeType
(TranscodeFileImpl file) private String
getOptionalLC
(String str) static DeviceManager
protected URL
getStreamURL
(TranscodeFileImpl file, String host) protected DeviceManagerUPnPImpl
(package private) void
importVuzeFile
(Map map, boolean warn_user) void
informPowerStateChange
(int new_state, Object data) (package private) void
initWithCore
(Core _core) boolean
isBusy
(int device_type) protected boolean
protected boolean
boolean
boolean
boolean
protected void
void
void
static void
protected void
removeDevice
(DeviceImpl device) void
void
removeListener
(DeviceManagerListener listener) protected void
requestAttention
(DeviceImpl device) boolean
requestPowerStateChange
(int new_state, Object data) protected void
void
search
(int millis, DeviceSearchListener listener) void
setAutoHideOldDevicesDays
(int days) void
setAutoSearch
(boolean auto) void
void
setDisableSleep
(boolean b) void
setRSSPublishEnabled
(boolean enabled) void
setTiVoEnabled
(boolean enabled) protected void
-
Field Details
-
LOGGER_NAME
- See Also:
-
CONFIG_FILE
- See Also:
-
AUTO_SEARCH_CONFIG_KEY
- See Also:
-
AUTO_HIDE_OLD_DAYS_DEFAULT
private static final int AUTO_HIDE_OLD_DAYS_DEFAULT- See Also:
-
AUTO_HIDE_OLD_CONFIG_KEY
- See Also:
-
RSS_ENABLE_CONFIG_KEY
- See Also:
-
OD_ENABLED_CONFIG_KEY
- See Also:
-
OD_IS_AUTO_CONFIG_KEY
- See Also:
-
OD_INCLUDE_PRIVATE_CONFIG_KEY
- See Also:
-
TRANSCODE_DIR_DEFAULT
- See Also:
-
CONFIG_DEFAULT_WORK_DIR
- See Also:
-
CONFIG_DISABLE_SLEEP
- See Also:
-
DEVICE_UPDATE_PERIOD
protected static final int DEVICE_UPDATE_PERIOD- See Also:
-
DEVICE_AUTO_HIDE_CHECK_PERIOD
protected static final int DEVICE_AUTO_HIDE_CHECK_PERIOD- See Also:
-
DEVICE_AUTO_HIDE_CHECK_TICKS
protected static final int DEVICE_AUTO_HIDE_CHECK_TICKS- See Also:
-
pre_initialised
private static boolean pre_initialised -
singleton
-
core
-
od_manual_ta
-
device_list
List<DeviceImpl> device_list -
device_map
-
tivo_manager
DeviceTivoManager tivo_manager -
upnp_manager
DeviceManagerUPnPImpl upnp_manager -
drive_manager
DeviceDriveManager drive_manager -
disable_events
-
LT_DEVICE_ADDED
private static final int LT_DEVICE_ADDED- See Also:
-
LT_DEVICE_CHANGED
private static final int LT_DEVICE_CHANGED- See Also:
-
LT_DEVICE_ATTENTION
private static final int LT_DEVICE_ATTENTION- See Also:
-
LT_DEVICE_REMOVED
private static final int LT_DEVICE_REMOVED- See Also:
-
LT_INITIALIZED
private static final int LT_INITIALIZED- See Also:
-
listeners
-
auto_search
boolean auto_search -
auto_hide_old_days
int auto_hide_old_days -
rss_publisher
-
closing
boolean closing -
config_unclean
boolean config_unclean -
config_dirty
boolean config_dirty -
explicit_search
int explicit_search -
transcode_manager
-
discovery_listeners
-
getMimeType_fails
private int getMimeType_fails -
logger_lock
-
logger
-
init_sem
-
initialized
private volatile boolean initialized -
lsn_lock
-
local_service_name
-
-
Constructor Details
-
DeviceManagerImpl
protected DeviceManagerImpl()
-
-
Method Details
-
preInitialise
public static void preInitialise() -
getSingleton
-
ensureInitialised
-
initWithCore
-
UPnPManagerStarted
protected void UPnPManagerStarted() -
getCore
-
getUPnPManager
-
getLocalServiceName
- Specified by:
getLocalServiceName
in interfaceDeviceManager
-
isTiVoEnabled
public boolean isTiVoEnabled()- Specified by:
isTiVoEnabled
in interfaceDeviceManager
-
setTiVoEnabled
public void setTiVoEnabled(boolean enabled) - Specified by:
setTiVoEnabled
in interfaceDeviceManager
-
getProviders
-
getDeviceTemplates
- Specified by:
getDeviceTemplates
in interfaceDeviceManager
-
getDeviceManufacturers
- Specified by:
getDeviceManufacturers
in interfaceDeviceManager
-
addVirtualDevice
public Device addVirtualDevice(int type, String uid, String classification, String name) throws DeviceManagerException - Specified by:
addVirtualDevice
in interfaceDeviceManager
- Throws:
DeviceManagerException
-
addInetDevice
public Device addInetDevice(int type, String uid, String classification, String name, InetAddress address) throws DeviceManagerException - Specified by:
addInetDevice
in interfaceDeviceManager
- Throws:
DeviceManagerException
-
createDevice
protected Device createDevice(int device_type, String uid, String classification, String name, boolean manual) throws DeviceManagerException - Throws:
DeviceManagerException
-
search
- Specified by:
search
in interfaceDeviceManager
-
getDevice
-
addDevice
-
addDevice
-
applyUpdates
-
getOptionalLC
-
removeDevice
-
isBusy
public boolean isBusy(int device_type) - Specified by:
isBusy
in interfaceDeviceManager
-
getDevices
- Specified by:
getDevices
in interfaceDeviceManager
-
getAutoSearch
public boolean getAutoSearch()- Specified by:
getAutoSearch
in interfaceDeviceManager
-
setAutoSearch
public void setAutoSearch(boolean auto) - Specified by:
setAutoSearch
in interfaceDeviceManager
-
getAutoHideOldDevicesDays
public int getAutoHideOldDevicesDays()- Specified by:
getAutoHideOldDevicesDays
in interfaceDeviceManager
-
setAutoHideOldDevicesDays
public void setAutoHideOldDevicesDays(int days) - Specified by:
setAutoHideOldDevicesDays
in interfaceDeviceManager
-
isRSSPublishEnabled
public boolean isRSSPublishEnabled()- Specified by:
isRSSPublishEnabled
in interfaceDeviceManager
-
setRSSPublishEnabled
public void setRSSPublishEnabled(boolean enabled) - Specified by:
setRSSPublishEnabled
in interfaceDeviceManager
-
getRSSLink
- Specified by:
getRSSLink
in interfaceDeviceManager
-
isExplicitSearch
protected boolean isExplicitSearch() -
isClosing
protected boolean isClosing() -
loadConfig
protected void loadConfig() -
configDirty
-
configDirty
protected void configDirty() -
saveConfig
protected void saveConfig() -
deviceAdded
-
deviceChanged
-
deviceRemoved
-
requestAttention
-
getStreamURL
-
getMimeType
-
getDefaultWorkingDirectory
- Specified by:
getDefaultWorkingDirectory
in interfaceDeviceManager
-
getDefaultWorkingDirectory
-
setDefaultWorkingDirectory
- Specified by:
setDefaultWorkingDirectory
in interfaceDeviceManager
-
getDisableSleep
public boolean getDisableSleep()- Specified by:
getDisableSleep
in interfaceDeviceManager
-
setDisableSleep
public void setDisableSleep(boolean b) - Specified by:
setDisableSleep
in interfaceDeviceManager
-
getTranscodeManager
- Specified by:
getTranscodeManager
in interfaceDeviceManager
-
isTranscodeManagerInitialized
public boolean isTranscodeManagerInitialized()- Specified by:
isTranscodeManagerInitialized
in interfaceDeviceManager
-
getUnassociatedDevices
- Specified by:
getUnassociatedDevices
in interfaceDeviceManager
-
getPowerName
- Specified by:
getPowerName
in interfacePowerManagementListener
-
requestPowerStateChange
- Specified by:
requestPowerStateChange
in interfacePowerManagementListener
-
informPowerStateChange
- Specified by:
informPowerStateChange
in interfacePowerManagementListener
-
addListener
- Specified by:
addListener
in interfaceDeviceManager
-
browseReceived
-
exportVuzeFile
- Throws:
IOException
-
importVuzeFile
-
addDiscoveryListener
- Specified by:
addDiscoveryListener
in interfaceDeviceManager
-
removeDiscoveryListener
- Specified by:
removeDiscoveryListener
in interfaceDeviceManager
-
removeListener
- Specified by:
removeListener
in interfaceDeviceManager
-
findDevice
- Specified by:
findDevice
in interfaceDeviceManager
- Returns:
-
getLogger
-
log
-
log
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-