com.aelitis.azureus.core.lws
Class LWSDiskManagerState

java.lang.Object
  extended by com.aelitis.azureus.core.lws.LWSDiskManagerState
All Implemented Interfaces:
DownloadManagerState

public class LWSDiskManagerState
extends java.lang.Object
implements DownloadManagerState


Field Summary
 
Fields inherited from interface org.gudy.azureus2.core3.download.DownloadManagerState
AT_AGGREGATE_SCRAPE_CACHE, AT_AVAIL_BAD_TIME, AT_CANONICAL_SD_DMAP, AT_CATEGORY, AT_COMPLETE_LAST_TIME, AT_DISPLAY_NAME, AT_DL_FILE_ALERTS, AT_DND_PREFIX, AT_DND_SUBFOLDER, AT_FILE_DOWNLOADED, AT_FILE_LINKS_DEPRECATED, AT_FILE_LINKS2, AT_FILE_OTHER_HASHES, AT_FILE_STORE_TYPES, AT_FILES_EXPANDED, AT_FLAGS, AT_INCOMP_FILE_SUFFIX, AT_LAST_ADDED_TO_ACTIVE_TAG, AT_MD_INFO_DICT_SIZE, AT_MERGED_DATA, AT_NETWORKS, AT_PARAMETERS, AT_PEAK_RECEIVE_RATE, AT_PEAK_SEND_RATE, AT_PEER_SOURCES, AT_PEER_SOURCES_DENIED, AT_PRIMARY_FILE, AT_PRIMARY_FILE_IDX, AT_RELATIVE_SAVE_PATH, AT_REORDER_MIN_MB, AT_RESUME_STATE, AT_SCRAPE_CACHE, AT_SCRAPE_CACHE_SOURCE, AT_SECRETS, AT_SHARE_RATIO_PROGRESS, AT_TIME_SINCE_DOWNLOAD, AT_TIME_SINCE_UPLOAD, AT_TIME_STOPPED, AT_TRACKER_CLIENT_EXTENSIONS, AT_USER, AT_USER_COMMENT, AT_VERSION, ATTRIBUTE_DEFAULTS, DEFAULT_MAX_UPLOADS, DEFAULT_UPLOAD_PRIORITY, FLAG_ALLOW_PERMITTED_PEER_SOURCE_CHANGES, FLAG_DISABLE_AUTO_FILE_MOVE, FLAG_DISABLE_IP_FILTER, FLAG_DO_NOT_DELETE_DATA_ON_REMOVE, FLAG_ERROR_REPORTED, FLAG_FORCE_DIRECT_DELETE, FLAG_INITIAL_NETWORKS_SET, FLAG_LOW_NOISE, FLAG_METADATA_DOWNLOAD, FLAG_MOVE_ON_COMPLETION_DONE, FLAG_ONLY_EVER_SEEDED, FLAG_SCAN_INCOMPLETE_PIECES, MIN_MAX_UPLOADS, PARAM_DND_FLAGS, PARAM_DOWNLOAD_ADDED_TIME, PARAM_DOWNLOAD_COMPLETED_TIME, PARAM_DOWNLOAD_FILE_COMPLETED_TIME, PARAM_DOWNLOAD_LAST_ACTIVE_TIME, PARAM_MAX_PEERS, PARAM_MAX_PEERS_WHEN_SEEDING, PARAM_MAX_PEERS_WHEN_SEEDING_ENABLED, PARAM_MAX_SEEDS, PARAM_MAX_SHARE_RATIO, PARAM_MAX_UPLOAD_WHEN_BUSY, PARAM_MAX_UPLOADS, PARAM_MAX_UPLOADS_WHEN_SEEDING, PARAM_MAX_UPLOADS_WHEN_SEEDING_ENABLED, PARAM_MIN_SHARE_RATIO, PARAM_RANDOM_SEED, PARAM_STATS_COUNTED, PARAM_UPLOAD_PRIORITY, PARAMETERS
 
Constructor Summary
protected LWSDiskManagerState()
           
 
Method Summary
 void addListener(DownloadManagerStateAttributeListener l, java.lang.String attribute, int event_type)
           
 void addListener(DownloadManagerStateListener l)
           
 void clearFileLinks()
           
 void clearResumeData()
           
 void clearTrackerResponseCache()
           
 void delete()
          deletes the saved state
 void discardFluff()
           
 void dump(IndentWriter writer)
           
 boolean exportState(java.io.File target_dir)
           
 void generateEvidence(IndentWriter writer)
           
 java.lang.String getAttribute(java.lang.String name)
           
 boolean getBooleanAttribute(java.lang.String name)
           
 boolean getBooleanParameter(java.lang.String name)
           
 Category getCategory()
           
 java.lang.String getDisplayName()
           
 DownloadManager getDownloadManager()
           
 java.io.File getFileLink(int source_index, java.io.File link_source)
           
 LinkFileMap getFileLinks()
          returns a File -> File map of the defined links (empty if no links)
 boolean getFlag(long flag)
           
 long getFlags()
           
 int getIntAttribute(java.lang.String name)
           
 int getIntParameter(java.lang.String name)
           
 java.lang.String[] getListAttribute(java.lang.String name)
           
 java.lang.String getListAttribute(java.lang.String name, int idx)
           
 long getLongAttribute(java.lang.String name)
           
 long getLongParameter(java.lang.String name)
           
 java.util.Map getMapAttribute(java.lang.String name)
           
 java.lang.String[] getNetworks()
           
 java.lang.String[] getPeerSources()
           
 DiskManagerFileInfo getPrimaryFile()
           
 java.lang.String getRelativeSavePath()
           
 java.util.Map getResumeData()
           
 java.io.File getStateFile()
           
 java.io.File getStateFile(java.lang.String name)
           
 TOTorrent getTorrent()
           
 java.lang.String getTrackerClientExtensions()
           
 java.util.Map getTrackerResponseCache()
           
 java.lang.String getUserComment()
           
 boolean hasAttribute(java.lang.String name)
           
 boolean isNetworkEnabled(java.lang.String network)
           
 boolean isOurContent()
           
 boolean isPeerSourceEnabled(java.lang.String peerSource)
           
 boolean isPeerSourcePermitted(java.lang.String peerSource)
           
 boolean isResumeDataComplete()
           
 boolean parameterExists(java.lang.String name)
           
 void removeListener(DownloadManagerStateAttributeListener l, java.lang.String attribute, int event_type)
           
 void removeListener(DownloadManagerStateListener l)
           
 void save()
           
 void setActive(boolean a)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 void setBooleanAttribute(java.lang.String name, boolean value)
           
 void setBooleanParameter(java.lang.String name, boolean value)
           
 void setCategory(Category cat)
           
 void setDisplayName(java.lang.String name)
           
 void setFileLink(int source_index, java.io.File link_source, java.io.File link_destination)
           
 void setFileLinks(java.util.List<java.lang.Integer> source_indexes, java.util.List<java.io.File> link_sources, java.util.List<java.io.File> link_destinations)
           
 void setFlag(long flag, boolean set)
           
 void setIntAttribute(java.lang.String name, int value)
           
 void setIntParameter(java.lang.String name, int value)
           
 void setListAttribute(java.lang.String name, java.lang.String[] values)
           
 void setLongAttribute(java.lang.String name, long value)
           
 void setLongParameter(java.lang.String name, long value)
           
 void setMapAttribute(java.lang.String name, java.util.Map value)
           
 void setNetworkEnabled(java.lang.String network, boolean enabled)
           
 void setNetworks(java.lang.String[] networks)
           
 void setParameterDefault(java.lang.String name)
          Reset to default value
 void setPeerSourceEnabled(java.lang.String source, boolean enabled)
           
 void setPeerSourcePermitted(java.lang.String peerSource, boolean permitted)
           
 void setPeerSources(java.lang.String[] networks)
           
 void setPrimaryFile(DiskManagerFileInfo dmfi)
           
 void setRelativeSavePath(java.lang.String path)
           
 void setResumeData(java.util.Map data)
           
 void setTrackerClientExtensions(java.lang.String value)
           
 void setTrackerResponseCache(java.util.Map value)
           
 void setUserComment(java.lang.String name)
           
 void suppressStateSave(boolean suppress)
          This method should only be invoked in matching try-finally pairs.
 void supressStateSave(boolean supress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWSDiskManagerState

protected LWSDiskManagerState()
Method Detail

getTorrent

public TOTorrent getTorrent()
Specified by:
getTorrent in interface DownloadManagerState

getStateFile

public java.io.File getStateFile(java.lang.String name)

getStateFile

public java.io.File getStateFile()
Specified by:
getStateFile in interface DownloadManagerState

getDownloadManager

public DownloadManager getDownloadManager()
Specified by:
getDownloadManager in interface DownloadManagerState

clearResumeData

public void clearResumeData()
Specified by:
clearResumeData in interface DownloadManagerState

getResumeData

public java.util.Map getResumeData()
Specified by:
getResumeData in interface DownloadManagerState

setResumeData

public void setResumeData(java.util.Map data)
Specified by:
setResumeData in interface DownloadManagerState

isResumeDataComplete

public boolean isResumeDataComplete()
Specified by:
isResumeDataComplete in interface DownloadManagerState

clearTrackerResponseCache

public void clearTrackerResponseCache()
Specified by:
clearTrackerResponseCache in interface DownloadManagerState

getTrackerResponseCache

public java.util.Map getTrackerResponseCache()
Specified by:
getTrackerResponseCache in interface DownloadManagerState

setTrackerResponseCache

public void setTrackerResponseCache(java.util.Map value)
Specified by:
setTrackerResponseCache in interface DownloadManagerState

setFlag

public void setFlag(long flag,
                    boolean set)
Specified by:
setFlag in interface DownloadManagerState

getFlag

public boolean getFlag(long flag)
Specified by:
getFlag in interface DownloadManagerState

getFlags

public long getFlags()
Specified by:
getFlags in interface DownloadManagerState

isOurContent

public boolean isOurContent()
Specified by:
isOurContent in interface DownloadManagerState
Returns:

getIntParameter

public int getIntParameter(java.lang.String name)
Specified by:
getIntParameter in interface DownloadManagerState

setIntParameter

public void setIntParameter(java.lang.String name,
                            int value)
Specified by:
setIntParameter in interface DownloadManagerState

getLongParameter

public long getLongParameter(java.lang.String name)
Specified by:
getLongParameter in interface DownloadManagerState

setParameterDefault

public void setParameterDefault(java.lang.String name)
Description copied from interface: DownloadManagerState
Reset to default value

Specified by:
setParameterDefault in interface DownloadManagerState

setLongParameter

public void setLongParameter(java.lang.String name,
                             long value)
Specified by:
setLongParameter in interface DownloadManagerState

getBooleanParameter

public boolean getBooleanParameter(java.lang.String name)
Specified by:
getBooleanParameter in interface DownloadManagerState

setBooleanParameter

public void setBooleanParameter(java.lang.String name,
                                boolean value)
Specified by:
setBooleanParameter in interface DownloadManagerState

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Specified by:
setAttribute in interface DownloadManagerState

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Specified by:
getAttribute in interface DownloadManagerState

setIntAttribute

public void setIntAttribute(java.lang.String name,
                            int value)
Specified by:
setIntAttribute in interface DownloadManagerState

getIntAttribute

public int getIntAttribute(java.lang.String name)
Specified by:
getIntAttribute in interface DownloadManagerState

setLongAttribute

public void setLongAttribute(java.lang.String name,
                             long value)
Specified by:
setLongAttribute in interface DownloadManagerState

getLongAttribute

public long getLongAttribute(java.lang.String name)
Specified by:
getLongAttribute in interface DownloadManagerState

setBooleanAttribute

public void setBooleanAttribute(java.lang.String name,
                                boolean value)
Specified by:
setBooleanAttribute in interface DownloadManagerState

getBooleanAttribute

public boolean getBooleanAttribute(java.lang.String name)
Specified by:
getBooleanAttribute in interface DownloadManagerState

hasAttribute

public boolean hasAttribute(java.lang.String name)
Specified by:
hasAttribute in interface DownloadManagerState

getTrackerClientExtensions

public java.lang.String getTrackerClientExtensions()
Specified by:
getTrackerClientExtensions in interface DownloadManagerState

setTrackerClientExtensions

public void setTrackerClientExtensions(java.lang.String value)
Specified by:
setTrackerClientExtensions in interface DownloadManagerState

setListAttribute

public void setListAttribute(java.lang.String name,
                             java.lang.String[] values)
Specified by:
setListAttribute in interface DownloadManagerState

getListAttribute

public java.lang.String[] getListAttribute(java.lang.String name)
Specified by:
getListAttribute in interface DownloadManagerState

getListAttribute

public java.lang.String getListAttribute(java.lang.String name,
                                         int idx)
Specified by:
getListAttribute in interface DownloadManagerState

setMapAttribute

public void setMapAttribute(java.lang.String name,
                            java.util.Map value)
Specified by:
setMapAttribute in interface DownloadManagerState

getMapAttribute

public java.util.Map getMapAttribute(java.lang.String name)
Specified by:
getMapAttribute in interface DownloadManagerState

getCategory

public Category getCategory()
Specified by:
getCategory in interface DownloadManagerState

setCategory

public void setCategory(Category cat)
Specified by:
setCategory in interface DownloadManagerState

setPrimaryFile

public void setPrimaryFile(DiskManagerFileInfo dmfi)
Specified by:
setPrimaryFile in interface DownloadManagerState

getPrimaryFile

public DiskManagerFileInfo getPrimaryFile()
Specified by:
getPrimaryFile in interface DownloadManagerState

getNetworks

public java.lang.String[] getNetworks()
Specified by:
getNetworks in interface DownloadManagerState

isNetworkEnabled

public boolean isNetworkEnabled(java.lang.String network)
Specified by:
isNetworkEnabled in interface DownloadManagerState

setNetworks

public void setNetworks(java.lang.String[] networks)
Specified by:
setNetworks in interface DownloadManagerState

setNetworkEnabled

public void setNetworkEnabled(java.lang.String network,
                              boolean enabled)
Specified by:
setNetworkEnabled in interface DownloadManagerState

getPeerSources

public java.lang.String[] getPeerSources()
Specified by:
getPeerSources in interface DownloadManagerState

isPeerSourcePermitted

public boolean isPeerSourcePermitted(java.lang.String peerSource)
Specified by:
isPeerSourcePermitted in interface DownloadManagerState

setPeerSourcePermitted

public void setPeerSourcePermitted(java.lang.String peerSource,
                                   boolean permitted)
Specified by:
setPeerSourcePermitted in interface DownloadManagerState

isPeerSourceEnabled

public boolean isPeerSourceEnabled(java.lang.String peerSource)
Specified by:
isPeerSourceEnabled in interface DownloadManagerState

setPeerSources

public void setPeerSources(java.lang.String[] networks)
Specified by:
setPeerSources in interface DownloadManagerState

setPeerSourceEnabled

public void setPeerSourceEnabled(java.lang.String source,
                                 boolean enabled)
Specified by:
setPeerSourceEnabled in interface DownloadManagerState

setFileLink

public void setFileLink(int source_index,
                        java.io.File link_source,
                        java.io.File link_destination)
Specified by:
setFileLink in interface DownloadManagerState

setFileLinks

public void setFileLinks(java.util.List<java.lang.Integer> source_indexes,
                         java.util.List<java.io.File> link_sources,
                         java.util.List<java.io.File> link_destinations)
Specified by:
setFileLinks in interface DownloadManagerState

discardFluff

public void discardFluff()
Specified by:
discardFluff in interface DownloadManagerState

clearFileLinks

public void clearFileLinks()
Specified by:
clearFileLinks in interface DownloadManagerState

getFileLink

public java.io.File getFileLink(int source_index,
                                java.io.File link_source)
Specified by:
getFileLink in interface DownloadManagerState

getFileLinks

public LinkFileMap getFileLinks()
Description copied from interface: DownloadManagerState
returns a File -> File map of the defined links (empty if no links)

Specified by:
getFileLinks in interface DownloadManagerState
Returns:

getUserComment

public java.lang.String getUserComment()
Specified by:
getUserComment in interface DownloadManagerState

setUserComment

public void setUserComment(java.lang.String name)
Specified by:
setUserComment in interface DownloadManagerState

getRelativeSavePath

public java.lang.String getRelativeSavePath()
Specified by:
getRelativeSavePath in interface DownloadManagerState

setRelativeSavePath

public void setRelativeSavePath(java.lang.String path)

setActive

public void setActive(boolean a)
Specified by:
setActive in interface DownloadManagerState

exportState

public boolean exportState(java.io.File target_dir)
Specified by:
exportState in interface DownloadManagerState

save

public void save()
Specified by:
save in interface DownloadManagerState

delete

public void delete()
Description copied from interface: DownloadManagerState
deletes the saved state

Specified by:
delete in interface DownloadManagerState

suppressStateSave

public void suppressStateSave(boolean suppress)
Description copied from interface: DownloadManagerState
This method should only be invoked in matching try-finally pairs. If it is invoked with true multiple times it must be invoked with false the equal amount of times to reallow state writes

Specified by:
suppressStateSave in interface DownloadManagerState
Parameters:
suppress - when set to true prevents flushing of the state/increments the internal nesting counter, decrements/allows flush otherwise

addListener

public void addListener(DownloadManagerStateListener l)
Specified by:
addListener in interface DownloadManagerState

removeListener

public void removeListener(DownloadManagerStateListener l)
Specified by:
removeListener in interface DownloadManagerState

addListener

public void addListener(DownloadManagerStateAttributeListener l,
                        java.lang.String attribute,
                        int event_type)
Specified by:
addListener in interface DownloadManagerState

removeListener

public void removeListener(DownloadManagerStateAttributeListener l,
                           java.lang.String attribute,
                           int event_type)
Specified by:
removeListener in interface DownloadManagerState

generateEvidence

public void generateEvidence(IndentWriter writer)
Specified by:
generateEvidence in interface DownloadManagerState

dump

public void dump(IndentWriter writer)
Specified by:
dump in interface DownloadManagerState

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface DownloadManagerState

setDisplayName

public void setDisplayName(java.lang.String name)
Specified by:
setDisplayName in interface DownloadManagerState

parameterExists

public boolean parameterExists(java.lang.String name)
Specified by:
parameterExists in interface DownloadManagerState
Returns:

supressStateSave

public void supressStateSave(boolean supress)