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

java.lang.Object
  extended by com.aelitis.azureus.core.devices.impl.DeviceImpl
All Implemented Interfaces:
Device
Direct Known Subclasses:
DeviceUPnPImpl

public abstract class DeviceImpl
extends Object
implements Device


Nested Class Summary
protected static class DeviceImpl.browseLocationImpl
           
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.core.devices.Device
Device.browseLocation
 
Field Summary
protected static String PP_AUTO_COPY
           
protected static boolean PP_AUTO_COPY_DEFAULT
           
protected static String PP_AUTO_START
           
protected static String PP_COPY_OUTSTANDING
           
protected static String PP_COPY_TO_FOLDER
           
protected static String PP_DONT_AUTO_HIDE
           
protected static String PP_EXPORTABLE
           
protected static String PP_FILTER_FILES
           
protected static String PP_IP_ADDRESS
           
protected static String PP_LIVENESS_DETECTABLE
           
protected static String PP_OD_ENABLED
           
protected static String PP_OD_MANUFACTURER
           
protected static String PP_OD_SHOWN_FTUX
           
protected static String PP_OD_STATE_CACHE
           
protected static String PP_OD_UPNP_DISC_CACHE
           
protected static String PP_OD_XFER_CACHE
           
protected static String PP_REND_CLASSIFICATION
           
protected static String PP_REND_SHOW_CAT
           
protected static String PP_RESTRICT_ACCESS
           
protected static String PP_TIVO_MACHINE
           
protected static boolean PR_AUTO_START_DEFAULT
           
protected static String TP_IP_ADDRESS
           
 
Fields inherited from interface com.aelitis.azureus.core.devices.Device
DT_CONTENT_DIRECTORY, DT_INTERNET, DT_INTERNET_GATEWAY, DT_MEDIA_RENDERER, DT_OFFLINE_DOWNLOADER, DT_UNKNOWN
 
Constructor Summary
protected 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
protected  void addDP(List<String[]> dp, String name, boolean value)
           
protected  void addDP(List<String[]> dp, String name, File value)
           
protected  void addDP(List<String[]> dp, String name, String value)
           
protected  void addDP(List<String[]> dp, String name, String[] values)
           
protected  void addDP(List<String[]> dp, String name, TranscodeProfile value)
           
protected  void addDP(List<String[]> dp, String name, TranscodeProfile[] values)
           
 void addListener(DeviceListener listener)
           
 void addListener(TranscodeTargetListener listener)
           
 void alive()
           
 com.aelitis.azureus.core.devices.impl.TranscodeFileImpl allocateFile(TranscodeProfile profile, boolean no_xcode, DiskManagerFileInfo file, boolean for_job)
           
protected  String allocateUniqueFileName(String str)
           
 boolean canRemove()
           
protected  void close()
           
protected  void dead()
           
protected  void deleteFile(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file, boolean delete_contents, boolean remove)
           
protected  void destroy()
           
protected  void exportToBEncodedMap(Map map, boolean for_export)
           
protected  void fileDirty(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file, int type, Object data)
           
protected  void fireChanged()
           
 void generate(IndentWriter writer)
           
 void generateTT(IndentWriter writer)
           
 boolean getAlwaysCacheFiles()
           
 long getAutoShareToTagID()
           
 TranscodeProfile getBlankProfile()
           
 String getClassification()
           
 TranscodeProfile getDefaultTranscodeProfile()
           
 Device getDevice()
           
protected  String getDeviceClassification()
           
protected  File getDeviceFile()
           
protected  File getDevicesDir()
           
 TranscodeProfile[] getDirectTranscodeProfiles()
           
 String[][] getDisplayProperties()
          Array of resource strings and their associated values
protected  void getDisplayProperties(List<String[]> dp)
           
 String getError()
           
 int getFileCount()
           
 com.aelitis.azureus.core.devices.impl.TranscodeFileImpl[] getFiles()
           
 String getID()
           
 String getImageID()
           
 String getInfo()
           
 long getLastSeen()
           
protected  DeviceManagerImpl getManager()
           
protected  String getMimeType(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file)
           
 String getName()
           
 boolean getPersistentBooleanProperty(String prop, boolean def)
           
 int getPersistentIntProperty(String prop, int def)
           
 long getPersistentLongProperty(String prop, long def)
           
<T> Map<String,T>
getPersistentMapProperty(String prop, Map<String,T> def)
           
 String[] getPersistentStringListProperty(String prop)
           
 String getPersistentStringProperty(String prop)
           
 String getPersistentStringProperty(String prop, String def)
           
 int getRendererSpecies()
           
protected  String getSecondaryID()
           
 String getShortDescription()
           
 String getStatus()
           
protected  URL getStreamURL(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file, String host)
           
 String getString()
           
protected  com.aelitis.azureus.core.devices.impl.TranscodeFileImpl getTranscodeFile(String key)
           
 TranscodeProfile[] getTranscodeProfiles()
           
 TranscodeProfile[] getTranscodeProfiles(boolean walkup)
           
 int getTranscodeRequirement()
           
 Object getTransientProperty(Object key)
           
 Object getTransientProperty(Object key1, Object key2)
           
protected  void getTTDisplayProperties(List<String[]> dp)
           
 int getType()
           
 VuzeFile getVuzeFile()
           
 URL getWikiURL()
           
 File getWorkingDirectory()
           
 File getWorkingDirectory(boolean persist)
           
protected static DeviceImpl importFromBEncodedMapStatic(DeviceManagerImpl manager, Map map)
           
protected  void initialise()
           
 boolean isAlive()
           
 boolean isAudioCompatible(TranscodeFile file)
           
 boolean isAutoHidden()
           
 boolean isBusy()
           
 boolean isExportable()
           
 boolean isGenericUSB()
           
 boolean isHidden()
           
 boolean isLivenessDetectable()
           
 boolean isManual()
           
 boolean isNameAutomatic()
           
 boolean isNonSimple()
           
 boolean isRSSPublishEnabled()
           
 boolean isTagged()
           
 boolean isTranscoding()
           
protected  void loadDeviceFile()
           
protected  void log(String str)
           
protected  void log(String str, Throwable e)
           
 com.aelitis.azureus.core.devices.impl.TranscodeFileImpl lookupFile(TranscodeProfile profile, DiskManagerFileInfo file)
           
 void remove()
           
 void removeListener(DeviceListener listener)
           
 void removeListener(TranscodeTargetListener listener)
           
 void removePersistentProperty(String prop)
           
 void requestAttention()
           
protected  void resetWorkingDirectory()
           
protected  void revertFileName(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl tf)
           
protected  void saveDeviceFile()
           
 void setAlwaysCacheFiles(boolean always_cache)
           
 void setAutoHidden(boolean h)
           
 void setAutoShareToTagID(long id)
           
protected  void setBusy(boolean busy)
           
 void setCanRemove(boolean can)
           
 void setDefaultTranscodeProfile(TranscodeProfile profile)
           
protected  void setDirty()
           
protected  void setDirty(boolean save_changes)
           
protected  void setError(Object key, String error)
           
 void setExportable(boolean b)
           
 void setGenericUSB(boolean is)
           
 void setHidden(boolean h)
           
 void setImageID(String id)
           
protected  void setInfo(Object key, String info)
           
 void setName(String _name, boolean isAutomaticName)
           
 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.aelitis.azureus.core.devices.Device
getAddress, getBrowseLocations, isBrowsable, setAddress
 

Field Detail

PP_REND_SHOW_CAT

protected static final String PP_REND_SHOW_CAT
See Also:
Constant Field Values

PP_REND_CLASSIFICATION

protected static final String PP_REND_CLASSIFICATION
See Also:
Constant Field Values

PP_IP_ADDRESS

protected static final String PP_IP_ADDRESS
See Also:
Constant Field Values

PP_DONT_AUTO_HIDE

protected static final String PP_DONT_AUTO_HIDE
See Also:
Constant Field Values

TP_IP_ADDRESS

protected static final String TP_IP_ADDRESS
See Also:
Constant Field Values

PP_FILTER_FILES

protected static final String PP_FILTER_FILES
See Also:
Constant Field Values

PP_RESTRICT_ACCESS

protected static final String PP_RESTRICT_ACCESS
See Also:
Constant Field Values

PP_COPY_OUTSTANDING

protected static final String PP_COPY_OUTSTANDING
See Also:
Constant Field Values

PP_AUTO_START

protected static final String PP_AUTO_START
See Also:
Constant Field Values

PP_COPY_TO_FOLDER

protected static final String PP_COPY_TO_FOLDER
See Also:
Constant Field Values

PP_AUTO_COPY

protected static final String PP_AUTO_COPY
See Also:
Constant Field Values

PP_EXPORTABLE

protected static final String PP_EXPORTABLE
See Also:
Constant Field Values

PP_LIVENESS_DETECTABLE

protected static final String PP_LIVENESS_DETECTABLE
See Also:
Constant Field Values

PP_TIVO_MACHINE

protected static final String PP_TIVO_MACHINE
See Also:
Constant Field Values

PP_OD_ENABLED

protected static final String PP_OD_ENABLED
See Also:
Constant Field Values

PP_OD_SHOWN_FTUX

protected static final String PP_OD_SHOWN_FTUX
See Also:
Constant Field Values

PP_OD_MANUFACTURER

protected static final String PP_OD_MANUFACTURER
See Also:
Constant Field Values

PP_OD_STATE_CACHE

protected static final String PP_OD_STATE_CACHE
See Also:
Constant Field Values

PP_OD_XFER_CACHE

protected static final String PP_OD_XFER_CACHE
See Also:
Constant Field Values

PP_OD_UPNP_DISC_CACHE

protected static final String PP_OD_UPNP_DISC_CACHE
See Also:
Constant Field Values

PR_AUTO_START_DEFAULT

protected static final boolean PR_AUTO_START_DEFAULT
See Also:
Constant Field Values

PP_AUTO_COPY_DEFAULT

protected static final boolean PP_AUTO_COPY_DEFAULT
See Also:
Constant Field Values
Constructor Detail

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

protected DeviceImpl(DeviceManagerImpl _manager,
                     Map map)
              throws IOException
Throws:
IOException
Method Detail

importFromBEncodedMapStatic

protected static DeviceImpl importFromBEncodedMapStatic(DeviceManagerImpl manager,
                                                        Map map)
                                                 throws IOException
Throws:
IOException

exportToBEncodedMap

protected void exportToBEncodedMap(Map map,
                                   boolean for_export)
                            throws IOException
Throws:
IOException

updateFrom

protected boolean updateFrom(DeviceImpl other,
                             boolean is_alive)

setExportable

public void setExportable(boolean b)
Specified by:
setExportable in interface Device

isExportable

public boolean isExportable()
Specified by:
isExportable in interface Device

getVuzeFile

public VuzeFile getVuzeFile()
                     throws IOException
Specified by:
getVuzeFile in interface Device
Throws:
IOException

initialise

protected void initialise()

destroy

protected void destroy()

getType

public int getType()
Specified by:
getType in interface Device

getID

public String getID()
Specified by:
getID in interface Device

setSecondaryID

protected void setSecondaryID(String str)

getSecondaryID

protected String getSecondaryID()

getImageID

public String getImageID()
Specified by:
getImageID in interface Device

setImageID

public void setImageID(String id)
Specified by:
setImageID in interface Device

getDevice

public Device getDevice()

getName

public String getName()
Specified by:
getName in interface Device

setName

public void setName(String _name,
                    boolean isAutomaticName)
Specified by:
setName in interface Device

isNameAutomatic

public boolean isNameAutomatic()
Specified by:
isNameAutomatic in interface Device

getClassification

public String getClassification()
Specified by:
getClassification in interface Device

getShortDescription

public String getShortDescription()
Specified by:
getShortDescription in interface Device

getRendererSpecies

public int getRendererSpecies()

getDeviceClassification

protected String getDeviceClassification()

isNonSimple

public boolean isNonSimple()

isManual

public boolean isManual()
Specified by:
isManual in interface Device

isHidden

public boolean isHidden()
Specified by:
isHidden in interface Device

setHidden

public void setHidden(boolean h)
Specified by:
setHidden in interface Device

isAutoHidden

public boolean isAutoHidden()

setAutoHidden

public void setAutoHidden(boolean h)

isTagged

public boolean isTagged()
Specified by:
isTagged in interface Device

setTagged

public void setTagged(boolean t)
Specified by:
setTagged in interface Device

isGenericUSB

public boolean isGenericUSB()
Specified by:
isGenericUSB in interface Device

setGenericUSB

public void setGenericUSB(boolean is)
Specified by:
setGenericUSB in interface Device

getLastSeen

public long getLastSeen()

alive

public void alive()
Specified by:
alive in interface Device

isLivenessDetectable

public boolean isLivenessDetectable()
Specified by:
isLivenessDetectable in interface Device

isAlive

public boolean isAlive()
Specified by:
isAlive in interface Device

dead

protected void dead()

getWikiURL

public URL getWikiURL()
Specified by:
getWikiURL in interface Device

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 interface Device

getFileCount

public int getFileCount()

getFiles

public com.aelitis.azureus.core.devices.impl.TranscodeFileImpl[] getFiles()

allocateFile

public com.aelitis.azureus.core.devices.impl.TranscodeFileImpl allocateFile(TranscodeProfile profile,
                                                                            boolean no_xcode,
                                                                            DiskManagerFileInfo file,
                                                                            boolean for_job)
                                                                     throws TranscodeException
Throws:
TranscodeException

allocateUniqueFileName

protected String allocateUniqueFileName(String str)

revertFileName

protected void revertFileName(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl tf)
                       throws TranscodeException
Throws:
TranscodeException

lookupFile

public com.aelitis.azureus.core.devices.impl.TranscodeFileImpl lookupFile(TranscodeProfile profile,
                                                                          DiskManagerFileInfo file)

getTranscodeFile

protected com.aelitis.azureus.core.devices.impl.TranscodeFileImpl getTranscodeFile(String key)

getWorkingDirectory

public File getWorkingDirectory()

getWorkingDirectory

public File getWorkingDirectory(boolean persist)

setWorkingDirectory

public void setWorkingDirectory(File directory)

resetWorkingDirectory

protected void resetWorkingDirectory()

getTranscodeProfiles

public TranscodeProfile[] getTranscodeProfiles()

getDirectTranscodeProfiles

public TranscodeProfile[] getDirectTranscodeProfiles()
Specified by:
getDirectTranscodeProfiles in interface Device

getTranscodeProfiles

public TranscodeProfile[] getTranscodeProfiles(boolean walkup)

getDefaultTranscodeProfile

public TranscodeProfile getDefaultTranscodeProfile()

setDefaultTranscodeProfile

public void setDefaultTranscodeProfile(TranscodeProfile profile)

getBlankProfile

public TranscodeProfile getBlankProfile()

setTranscoding

protected void setTranscoding(boolean _transcoding)

isTranscoding

public boolean isTranscoding()

getTranscodeRequirement

public int getTranscodeRequirement()

setTranscodeRequirement

public void setTranscodeRequirement(int req)

isAudioCompatible

public boolean isAudioCompatible(TranscodeFile file)

getAlwaysCacheFiles

public boolean getAlwaysCacheFiles()

setAlwaysCacheFiles

public void setAlwaysCacheFiles(boolean always_cache)

isRSSPublishEnabled

public boolean isRSSPublishEnabled()

setRSSPublishEnabled

public void setRSSPublishEnabled(boolean enabled)

getAutoShareToTagID

public long getAutoShareToTagID()

setAutoShareToTagID

public void setAutoShareToTagID(long id)

getDisplayProperties

public String[][] getDisplayProperties()
Description copied from interface: Device
Array of resource strings and their associated values

Specified by:
getDisplayProperties in interface Device
Returns:

getDisplayProperties

protected void getDisplayProperties(List<String[]> dp)

getTTDisplayProperties

protected void getTTDisplayProperties(List<String[]> dp)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     String value)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     File value)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     String[] values)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     boolean value)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     TranscodeProfile value)

addDP

protected void addDP(List<String[]> dp,
                     String name,
                     TranscodeProfile[] values)

setCanRemove

public void setCanRemove(boolean can)
Specified by:
setCanRemove in interface Device

canRemove

public boolean canRemove()
Specified by:
canRemove in interface Device

isBusy

public boolean isBusy()
Specified by:
isBusy in interface Device

setBusy

protected void setBusy(boolean busy)

remove

public void remove()
Specified by:
remove in interface Device

getPersistentStringProperty

public String getPersistentStringProperty(String prop)

getPersistentStringProperty

public String getPersistentStringProperty(String prop,
                                          String def)

setPersistentStringProperty

public void setPersistentStringProperty(String prop,
                                        String value)

getPersistentMapProperty

public <T> Map<String,T> getPersistentMapProperty(String prop,
                                                  Map<String,T> def)

setPersistentMapProperty

public <T> void setPersistentMapProperty(String prop,
                                         Map<String,T> value)

removePersistentProperty

public void removePersistentProperty(String prop)

getError

public String getError()
Specified by:
getError in interface Device

setError

protected void setError(Object key,
                        String error)

getInfo

public String getInfo()
Specified by:
getInfo in interface Device

setInfo

protected void setInfo(Object key,
                       String info)

getStatus

public String getStatus()
Specified by:
getStatus in interface Device

getPersistentBooleanProperty

public boolean getPersistentBooleanProperty(String prop,
                                            boolean def)

setPersistentBooleanProperty

public void setPersistentBooleanProperty(String prop,
                                         boolean value)

getPersistentLongProperty

public long getPersistentLongProperty(String prop,
                                      long def)

setPersistentLongProperty

public void setPersistentLongProperty(String prop,
                                      long value)

getPersistentIntProperty

public int getPersistentIntProperty(String prop,
                                    int def)

setPersistentIntProperty

public void setPersistentIntProperty(String prop,
                                     int value)

getPersistentStringListProperty

public String[] getPersistentStringListProperty(String prop)

setPersistentStringListProperty

public void setPersistentStringListProperty(String prop,
                                            String[] values)

setTransientProperty

public void setTransientProperty(Object key,
                                 Object value)
Specified by:
setTransientProperty in interface Device

getTransientProperty

public Object getTransientProperty(Object key)
Specified by:
getTransientProperty in interface Device

setTransientProperty

public void setTransientProperty(Object key1,
                                 Object key2,
                                 Object value)

getTransientProperty

public Object getTransientProperty(Object key1,
                                   Object key2)

close

protected void close()

loadDeviceFile

protected void loadDeviceFile()
                       throws IOException
Throws:
IOException

getStreamURL

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

getMimeType

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

deleteFile

protected void deleteFile(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file,
                          boolean delete_contents,
                          boolean remove)
                   throws TranscodeException
Throws:
TranscodeException

fileDirty

protected void fileDirty(com.aelitis.azureus.core.devices.impl.TranscodeFileImpl file,
                         int type,
                         Object data)

saveDeviceFile

protected void saveDeviceFile()

getDeviceFile

protected File getDeviceFile()
                      throws IOException
Throws:
IOException

getDevicesDir

protected File getDevicesDir()
                      throws IOException
Throws:
IOException

getManager

protected DeviceManagerImpl getManager()

addListener

public void addListener(TranscodeTargetListener listener)

removeListener

public void removeListener(TranscodeTargetListener listener)

fireChanged

protected void fireChanged()

addListener

public void addListener(DeviceListener listener)
Specified by:
addListener in interface Device

removeListener

public void removeListener(DeviceListener listener)
Specified by:
removeListener in interface Device

log

protected void log(String str)

log

protected void log(String str,
                   Throwable e)

getString

public String getString()
Specified by:
getString in interface Device

generate

public void generate(IndentWriter writer)

generateTT

public void generateTT(IndentWriter writer)