Package com.biglybt.core.devices.impl
Class DeviceImpl
java.lang.Object
com.biglybt.core.devices.impl.DeviceImpl
- All Implemented Interfaces:
Device
- Direct Known Subclasses:
DeviceUPnPImpl
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.biglybt.core.devices.Device
Device.browseLocation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final TranscodeProfile
private int
private boolean
private String
(package private) boolean
(package private) long
private WeakReference<Map<String,
Map<String, ?>>> private CopyOnWriteList<DeviceListener>
private static final String
private boolean
private String
private boolean
private boolean
private static final Object
private long
private CopyOnWriteList<TranscodeTargetListener>
private DeviceManagerImpl
private boolean
private static final String
private String
private boolean
protected static final String
protected static final boolean
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
private static final String
private static final String
protected static final String
private static final String
private static final String
private static final String
private static final String
protected static final String
protected static final String
protected static final boolean
private String
private boolean
protected static final String
private boolean
private int
private String
Fields inherited from interface com.biglybt.core.devices.Device
DT_CONTENT_DIRECTORY, DT_DISK_OPS, DT_INTERNET, DT_INTERNET_GATEWAY, DT_MEDIA_RENDERER, DT_UNKNOWN
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DeviceImpl
(DeviceManagerImpl _manager, int _type, String _uid, String _classification, boolean _manual) protected
DeviceImpl
(DeviceManagerImpl _manager, int _type, String _uid, String _classification, boolean _manual, String _name) protected
DeviceImpl
(DeviceManagerImpl _manager, Map map) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addDP
(List<String[]> dp, String name, TranscodeProfile value) protected void
addDP
(List<String[]> dp, String name, TranscodeProfile[] values) protected void
protected void
protected void
void
addListener
(DeviceListener listener) void
addListener
(TranscodeTargetListener listener) void
alive()
allocateFile
(TranscodeProfile profile, boolean no_xcode, DiskManagerFileInfo file, boolean for_job) protected String
boolean
protected void
close()
protected void
dead()
protected void
deleteFile
(TranscodeFileImpl file, boolean delete_contents, boolean remove) protected void
destroy()
protected void
exportToBEncodedMap
(Map map, boolean for_export) protected void
fileDirty
(TranscodeFileImpl file, int type, Object data) protected void
void
generate
(IndentWriter writer) void
generateTT
(IndentWriter writer) boolean
long
protected String
protected File
protected File
String[][]
Array of resource strings and their associated valuesprotected void
getDisplayProperties
(List<String[]> dp) getError()
int
getFiles()
getID()
getInfo()
long
protected DeviceManagerImpl
protected String
getMimeType
(TranscodeFileImpl file) getName()
boolean
getPersistentBooleanProperty
(String prop, boolean def) int
getPersistentIntProperty
(String prop, int def) long
getPersistentLongProperty
(String prop, long def) getPersistentMapProperty
(String prop, Map<String, T> def) String[]
getPersistentStringProperty
(String prop, String def) int
protected String
protected URL
getStreamURL
(TranscodeFileImpl file, String host) protected TranscodeFileImpl
getTranscodeFile
(String key) getTranscodeProfiles
(boolean walkup) private TranscodeProfile[]
getTranscodeProfiles
(String classification) int
getTransientProperty
(Object key1, Object key2) protected void
getTTDisplayProperties
(List<String[]> dp) int
getType()
getWorkingDirectory
(boolean persist) protected static DeviceImpl
importFromBEncodedMapStatic
(DeviceManagerImpl manager, Map map) protected void
boolean
isAlive()
boolean
boolean
boolean
isBusy()
boolean
boolean
boolean
isHidden()
boolean
boolean
isManual()
boolean
boolean
boolean
boolean
isTagged()
boolean
protected void
protected void
protected void
lookupFile
(TranscodeProfile profile, DiskManagerFileInfo file) private static String
void
remove()
void
removeListener
(DeviceListener listener) void
removeListener
(TranscodeTargetListener listener) void
void
protected void
protected void
protected void
void
setAlwaysCacheFiles
(boolean always_cache) void
setAutoHidden
(boolean h) void
setAutoShareToTagID
(long id) protected void
setBusy
(boolean busy) void
setCanRemove
(boolean can) void
protected void
setDirty()
protected void
setDirty
(boolean save_changes) protected void
void
setExportable
(boolean b) void
setGenericUSB
(boolean is) void
setHidden
(boolean h) void
setImageID
(String id) protected void
void
void
setPersistentBooleanProperty
(String prop, boolean value) void
setPersistentIntProperty
(String prop, int value) void
setPersistentLongProperty
(String prop, long value) <T> void
setPersistentMapProperty
(String prop, Map<String, T> value) void
setPersistentStringListProperty
(String prop, String[] values) void
setPersistentStringProperty
(String prop, String value) void
setRSSPublishEnabled
(boolean enabled) protected void
setSecondaryID
(String str) void
setTagged
(boolean t) void
setTranscodeRequirement
(int req) protected void
setTranscoding
(boolean _transcoding) void
setTransientProperty
(Object key, Object value) void
setTransientProperty
(Object key1, Object key2, Object value) void
setWorkingDirectory
(File directory) protected boolean
updateFrom
(DeviceImpl other, boolean is_alive) protected void
updateStatus
(int tick_count) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.devices.Device
getAddress, getBrowseLocations, isBrowsable, setAddress
-
Field Details
-
MY_PACKAGE
- See Also:
-
blank_profile
-
device_renames
-
PP_REND_WORK_DIR
- See Also:
-
PP_REND_DEF_TRANS_PROF
- See Also:
-
PP_REND_TRANS_REQ
- See Also:
-
PP_REND_TRANS_CACHE
- See Also:
-
PP_REND_RSS_PUB
- See Also:
-
PP_REND_TAG_SHARE
- See Also:
-
PP_REND_SHOW_CAT
- See Also:
-
PP_REND_CLASSIFICATION
- See Also:
-
PP_IP_ADDRESS
- See Also:
-
PP_DONT_AUTO_HIDE
- See Also:
-
TP_IP_ADDRESS
- See Also:
-
PP_FILTER_FILES
- See Also:
-
PP_RESTRICT_ACCESS
- See Also:
-
PP_COPY_OUTSTANDING
- See Also:
-
PP_AUTO_START
- See Also:
-
PP_COPY_TO_FOLDER
- See Also:
-
PP_AUTO_COPY
- See Also:
-
PP_EXPORTABLE
- See Also:
-
PP_LIVENESS_DETECTABLE
- See Also:
-
PP_TIVO_MACHINE
- See Also:
-
PP_OD_ENABLED
- See Also:
-
PP_OD_SHOWN_FTUX
- See Also:
-
PP_OD_MANUFACTURER
- See Also:
-
PP_OD_STATE_CACHE
- See Also:
-
PP_OD_XFER_CACHE
- See Also:
-
PP_OD_UPNP_DISC_CACHE
- See Also:
-
PR_AUTO_START_DEFAULT
protected static final boolean PR_AUTO_START_DEFAULT- See Also:
-
PP_AUTO_COPY_DEFAULT
protected static final boolean PP_AUTO_COPY_DEFAULT- See Also:
-
GENERIC
- See Also:
-
KEY_FILE_ALLOC_ERROR
-
manager
-
type
private int type -
uid
-
secondary_uid
-
classification
-
name
-
manual
private boolean manual -
isGenericUSB
private boolean isGenericUSB -
last_seen
private long last_seen -
can_remove
private boolean can_remove -
tagged
private boolean tagged -
busy_count
private int busy_count -
online
private boolean online -
transcoding
private boolean transcoding -
persistent_properties
-
transient_properties
-
device_files_last_mod
long device_files_last_mod -
device_files_dirty
boolean device_files_dirty -
device_files
-
device_files_ref
-
listeners
-
errors
-
infos
-
device_listeners
-
image_id
-
isNameAutomatic
private boolean isNameAutomatic
-
-
Constructor Details
-
DeviceImpl
protected DeviceImpl(DeviceManagerImpl _manager, int _type, String _uid, String _classification, boolean _manual) -
DeviceImpl
protected DeviceImpl(DeviceManagerImpl _manager, int _type, String _uid, String _classification, boolean _manual, String _name) -
DeviceImpl
- Throws:
IOException
-
-
Method Details
-
importFromBEncodedMapStatic
protected static DeviceImpl importFromBEncodedMapStatic(DeviceManagerImpl manager, Map map) throws IOException - Throws:
IOException
-
modifyDeviceDisplayName
-
exportToBEncodedMap
- Throws:
IOException
-
updateFrom
-
setExportable
public void setExportable(boolean b) - Specified by:
setExportable
in interfaceDevice
-
isExportable
public boolean isExportable()- Specified by:
isExportable
in interfaceDevice
-
getVuzeFile
- Specified by:
getVuzeFile
in interfaceDevice
- Throws:
IOException
-
initialise
protected void initialise() -
destroy
protected void destroy() -
getType
public int getType() -
getID
-
setSecondaryID
-
getSecondaryID
-
getImageID
- Specified by:
getImageID
in interfaceDevice
-
getImageIDs
- Specified by:
getImageIDs
in interfaceDevice
-
setImageID
- Specified by:
setImageID
in interfaceDevice
-
getDevice
-
getName
-
setName
-
isNameAutomatic
public boolean isNameAutomatic()- Specified by:
isNameAutomatic
in interfaceDevice
-
getClassification
- Specified by:
getClassification
in interfaceDevice
-
getShortDescription
- Specified by:
getShortDescription
in interfaceDevice
-
getRendererSpecies
public int getRendererSpecies() -
getDeviceClassification
-
isNonSimple
public boolean isNonSimple() -
isManual
public boolean isManual() -
isHidden
public boolean isHidden() -
setHidden
public void setHidden(boolean h) -
isAutoHidden
public boolean isAutoHidden() -
setAutoHidden
public void setAutoHidden(boolean h) -
isTagged
public boolean isTagged() -
setTagged
public void setTagged(boolean t) -
isGenericUSB
public boolean isGenericUSB()- Specified by:
isGenericUSB
in interfaceDevice
-
setGenericUSB
public void setGenericUSB(boolean is) - Specified by:
setGenericUSB
in interfaceDevice
-
getLastSeen
public long getLastSeen() -
alive
public void alive() -
isLivenessDetectable
public boolean isLivenessDetectable()- Specified by:
isLivenessDetectable
in interfaceDevice
-
isAlive
public boolean isAlive() -
dead
protected void dead() -
getWikiURL
- Specified by:
getWikiURL
in interfaceDevice
-
setDirty
protected void setDirty() -
setDirty
protected void setDirty(boolean save_changes) -
updateStatus
protected void updateStatus(int tick_count) -
requestAttention
public void requestAttention()- Specified by:
requestAttention
in interfaceDevice
-
getFileCount
public int getFileCount() -
getFiles
-
allocateFile
public TranscodeFileImpl allocateFile(TranscodeProfile profile, boolean no_xcode, DiskManagerFileInfo file, boolean for_job) throws TranscodeException - Throws:
TranscodeException
-
allocateUniqueFileName
-
revertFileName
- Throws:
TranscodeException
-
lookupFile
-
getTranscodeFile
-
getWorkingDirectory
-
getWorkingDirectory
-
setWorkingDirectory
-
resetWorkingDirectory
protected void resetWorkingDirectory() -
getTranscodeProfiles
-
getDirectTranscodeProfiles
- Specified by:
getDirectTranscodeProfiles
in interfaceDevice
-
getTranscodeProfiles
-
getTranscodeProfiles
-
getDefaultTranscodeProfile
-
setDefaultTranscodeProfile
-
getBlankProfile
-
setTranscoding
protected void setTranscoding(boolean _transcoding) -
isTranscoding
public boolean isTranscoding() -
getTranscodeRequirement
public int getTranscodeRequirement() -
setTranscodeRequirement
public void setTranscodeRequirement(int req) -
isAudioCompatible
-
getAlwaysCacheFiles
public boolean getAlwaysCacheFiles() -
setAlwaysCacheFiles
public void setAlwaysCacheFiles(boolean always_cache) -
isRSSPublishEnabled
public boolean isRSSPublishEnabled() -
setRSSPublishEnabled
public void setRSSPublishEnabled(boolean enabled) -
getDisplayProperties
Description copied from interface:Device
Array of resource strings and their associated values- Specified by:
getDisplayProperties
in interfaceDevice
- Returns:
-
getDisplayProperties
-
getTTDisplayProperties
-
addDP
-
addDP
-
addDP
-
addDP
-
addDP
-
addDP
-
setCanRemove
public void setCanRemove(boolean can) - Specified by:
setCanRemove
in interfaceDevice
-
canRemove
public boolean canRemove() -
isBusy
public boolean isBusy() -
setBusy
protected void setBusy(boolean busy) -
remove
public void remove() -
getPersistentStringProperty
-
getPersistentStringProperty
-
setPersistentStringProperty
-
getPersistentMapProperty
-
setPersistentMapProperty
-
removePersistentProperty
-
getError
-
setError
-
getInfo
-
setInfo
-
getStatus
-
getPersistentBooleanProperty
-
setPersistentBooleanProperty
-
getPersistentLongProperty
-
setPersistentLongProperty
-
getPersistentIntProperty
-
setPersistentIntProperty
-
getPersistentStringListProperty
-
setPersistentStringListProperty
-
setTransientProperty
- Specified by:
setTransientProperty
in interfaceDevice
-
getTransientProperty
- Specified by:
getTransientProperty
in interfaceDevice
-
setTransientProperty
-
getTransientProperty
-
close
protected void close() -
loadDeviceFile
- Throws:
IOException
-
getStreamURL
-
getMimeType
-
deleteFile
protected void deleteFile(TranscodeFileImpl file, boolean delete_contents, boolean remove) throws TranscodeException - Throws:
TranscodeException
-
fileDirty
-
saveDeviceFile
protected void saveDeviceFile() -
getDeviceFile
- Throws:
IOException
-
getDevicesDir
- Throws:
IOException
-
getManager
-
addListener
-
removeListener
-
fireChanged
protected void fireChanged() -
addListener
- Specified by:
addListener
in interfaceDevice
-
removeListener
- Specified by:
removeListener
in interfaceDevice
-
log
-
log
-
getString
-
generate
-
generateTT
-