Naanou.ResourceExchange
Class Config

Field Summary
string application
string APPLICATION
string[] applicationExt
string archive
string ARCHIVE
string[] archiveExt
string audio
string AUDIO
string[] audioExt
System.Version BACK_COMPAT_VERSION
string BLOCK_STORAGE_MAX
string BLOCK_STORAGE_PATH
string BLOCK_STORAGE_TIMEOUT
int blockStorageMax
string blockStoragePath
int blockStorageTimeout
string document
string DOCUMENT
string[] documentExt
string DOWNLOAD_IDEAL_TIME
string DOWNLOAD_MAX
string DOWNLOAD_MAX_SWARM
string DOWNLOAD_MAX_SWARM_PER_HOST
string DOWNLOAD_WAIT_TIME
int downloadIdealTime
int downloadMaximum
int downloadMaxSwarm
int downloadMaxSwarmPerHost
int downloadWaitTime
string HOST_RETRY_LIMIT
string HOST_TIMEOUT
int hostRetryLimit
int hostTimeout
string image
string IMAGE
string[] imageExt
string INCLUDE_HIDDEN
bool includeHidden
bool initialized
int KEY_LIFETIME
         How long keys are kept for (mins)
double KEY_REPUBLISH_RATIO
         Ratio multiplied by KEY_LIFETIME gives how long (mins) client will wait until republishing
string other
string OTHER
string[] otherExt
string SERVER_EMAIL_CONTACT
string SERVER_IM_CONTACT
string SERVER_MOTD
string SERVER_NAME
string SERVER_PORT
string SERVER_THROTTLE
string SERVER_WEB_CONTACT
string serverEmailContact
string serverImContact
string serverMotd
string serverName
int serverPort
long serverThrottle
string serverWebContact
System.Collections.Hashtable validExtensions
System.Version VERSION
string video
string VIDEO
string[] videoExt

Constructor Summary
Config()
        Initializes a new instance of the Config class.

Property Summary
string[] Application
         Application file extensions
string[] Archive
         Archive file extensions
string[] Audio
         Audio file extensions
int BlockStorageMax
         Maximum size in megabytes block storage should reach.
string BlockStoragePath
         Path for storing blocks, e.g \blocks\. Resolved to absolute path on runtime, Always has trailing slash.
int BlockStorageTimeout
         Maximum age of a block (in minutes) before it is considered stale if uncomplete
string[] Document
         Document allowable file extensions
int DownloadIdealTime
         Gets the number of seconds that a one single block (of variable size, starting at 2^9KB) should transfer in. This affects how big download chunks from hosts are depending on their speed.
int DownloadMaximum
         Gets the maximum number of resources that can be downloaded at once. Keep in mind that for each resource, up to DownloadMaxSwarm simultaneous connections will be used to get the resource.
int DownloadMaxSwarm
         Total number of simultaneous downloads per resource. This setting also determines the total number of simultaneous uploads available to others from this host.
int DownloadMaxSwarmPerHost
         Total number of simultaneous downloads per source
int DownloadWaitTime
         Number of seconds to wait inbetween retrying a download
int HostRetryLimit
         Number times a host will be retried if it timesout before it is finally given up on
int HostTimeout
         Number of seconds to wait for requests/replies to a remote host before it is considered dead
string[] Image
         Image file extensions
bool IncludeHidden
         Should hidden directories/files be included?
string[] Other
         Other allowable file extensions
string[] ServerContacts
         Returns server contacts in email, im, web order
string ServerMotd
         Server message of the day (maximum 1000 chars)
string ServerName
         Server name (maximum 200 chars)
int ServerPort
         Port to use for webserver. Set to -1 for a random port
long ServerThrottle
         A per-outgoing connection throttle rate (in bytes per second). Set to 0 for no throttling
string[] Video
         Video file extensions

Method Summary
Naanou.Common.FileCategory GetExtensionCategory(string extension)
         Case-insensitive checks if the extension is valid for indexing
object IConfigurationSectionHandler.Create(object parent, object configContext, System.Xml.XmlNode section)
void Initialize()
string ReadSetting(System.Collections.Specialized.NameValueCollection settings, string key, string defaultValue)
         Reads string setting
int ReadSetting(System.Collections.Specialized.NameValueCollection settings, string key, int defaultValue)
         Reads int setting
long ReadSetting(System.Collections.Specialized.NameValueCollection settings, string key, long defaultValue)
         Reads long setting
bool ReadSetting(System.Collections.Specialized.NameValueCollection settings, string key, bool defaultValue)
         Reads boolean setting
string StripHTML(string text)
bool ValidExtension(string extension)
         Case-insensitive checks if the extension is valid for indexing

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

application

private string application


APPLICATION

private string APPLICATION


applicationExt

private string[] applicationExt


archive

private string archive


ARCHIVE

private string ARCHIVE


archiveExt

private string[] archiveExt


audio

private string audio


AUDIO

private string AUDIO


audioExt

private string[] audioExt


BACK_COMPAT_VERSION

internal System.Version BACK_COMPAT_VERSION


BLOCK_STORAGE_MAX

private string BLOCK_STORAGE_MAX


BLOCK_STORAGE_PATH

private string BLOCK_STORAGE_PATH


BLOCK_STORAGE_TIMEOUT

private string BLOCK_STORAGE_TIMEOUT


blockStorageMax

private int blockStorageMax


blockStoragePath

private string blockStoragePath


blockStorageTimeout

private int blockStorageTimeout


document

private string document


DOCUMENT

private string DOCUMENT


documentExt

private string[] documentExt


DOWNLOAD_IDEAL_TIME

private string DOWNLOAD_IDEAL_TIME


DOWNLOAD_MAX

private string DOWNLOAD_MAX


DOWNLOAD_MAX_SWARM

private string DOWNLOAD_MAX_SWARM


DOWNLOAD_MAX_SWARM_PER_HOST

private string DOWNLOAD_MAX_SWARM_PER_HOST


DOWNLOAD_WAIT_TIME

private string DOWNLOAD_WAIT_TIME


downloadIdealTime

private int downloadIdealTime


downloadMaximum

private int downloadMaximum


downloadMaxSwarm

private int downloadMaxSwarm


downloadMaxSwarmPerHost

private int downloadMaxSwarmPerHost


downloadWaitTime

private int downloadWaitTime


HOST_RETRY_LIMIT

private string HOST_RETRY_LIMIT


HOST_TIMEOUT

private string HOST_TIMEOUT


hostRetryLimit

private int hostRetryLimit


hostTimeout

private int hostTimeout


image

private string image


IMAGE

private string IMAGE


imageExt

private string[] imageExt


INCLUDE_HIDDEN

private string INCLUDE_HIDDEN


includeHidden

private bool includeHidden


initialized

private bool initialized


KEY_LIFETIME

public int KEY_LIFETIME

How long keys are kept for (mins)


KEY_REPUBLISH_RATIO

public double KEY_REPUBLISH_RATIO

Ratio multiplied by KEY_LIFETIME gives how long (mins) client will wait until republishing


other

private string other


OTHER

private string OTHER


otherExt

private string[] otherExt


SERVER_EMAIL_CONTACT

private string SERVER_EMAIL_CONTACT


SERVER_IM_CONTACT

private string SERVER_IM_CONTACT


SERVER_MOTD

private string SERVER_MOTD


SERVER_NAME

private string SERVER_NAME


SERVER_PORT

private string SERVER_PORT


SERVER_THROTTLE

private string SERVER_THROTTLE


SERVER_WEB_CONTACT

private string SERVER_WEB_CONTACT


serverEmailContact

private string serverEmailContact


serverImContact

private string serverImContact


serverMotd

private string serverMotd


serverName

private string serverName


serverPort

private int serverPort


serverThrottle

private long serverThrottle


serverWebContact

private string serverWebContact


validExtensions

private System.Collections.Hashtable validExtensions


VERSION

internal System.Version VERSION


video

private string video


VIDEO

private string VIDEO


videoExt

private string[] videoExt

Constructor Detail

Config

public Config()

Initializes a new instance of the Config class.

Property Detail

Application

internal string[] Application

Application file extensions


Archive

internal string[] Archive

Archive file extensions


Audio

internal string[] Audio

Audio file extensions


BlockStorageMax

internal int BlockStorageMax

Maximum size in megabytes block storage should reach.

Minimum 10mb


BlockStoragePath

internal string BlockStoragePath

Path for storing blocks, e.g \blocks\. Resolved to absolute path on runtime, Always has trailing slash.


BlockStorageTimeout

internal int BlockStorageTimeout

Maximum age of a block (in minutes) before it is considered stale if uncomplete

Minimum 5


Document

internal string[] Document

Document allowable file extensions


DownloadIdealTime

internal int DownloadIdealTime

Gets the number of seconds that a one single block (of variable size, starting at 2^9KB) should transfer in. This affects how big download chunks from hosts are depending on their speed.

Minimum 60. Attempts to keep downloads within 30 (Source.DOWNLOAD_IDEAL_TIME_RANGE) seconds of this figure


DownloadMaximum

internal int DownloadMaximum

Gets the maximum number of resources that can be downloaded at once. Keep in mind that for each resource, up to DownloadMaxSwarm simultaneous connections will be used to get the resource.

Minimum 1. This setting, along with DownloadMaxSwarmPerHost determines how many simultaneous connections are available to users getting data from you. The outgoing connection limit is kept to DownloadMaximum * DownloadMaxSwarm. For example, if DownloadMaximum is set to 3 (maximum of 3 files are retrieved at once), and DownloadMaxSwarm is set to 5 (Up to 5 parts of the file will be downloaded at once), upto 15 outgoing connections be allowed.


DownloadMaxSwarm

internal int DownloadMaxSwarm

Total number of simultaneous downloads per resource. This setting also determines the total number of simultaneous uploads available to others from this host.

Minimum 1


DownloadMaxSwarmPerHost

internal int DownloadMaxSwarmPerHost

Total number of simultaneous downloads per source

Minimum 1.


DownloadWaitTime

internal int DownloadWaitTime

Number of seconds to wait inbetween retrying a download

Minimum 5


HostRetryLimit

internal int HostRetryLimit

Number times a host will be retried if it timesout before it is finally given up on


HostTimeout

internal int HostTimeout

Number of seconds to wait for requests/replies to a remote host before it is considered dead

Minimum 1


Image

internal string[] Image

Image file extensions


IncludeHidden

internal bool IncludeHidden

Should hidden directories/files be included?


Other

internal string[] Other

Other allowable file extensions


ServerContacts

internal string[] ServerContacts

Returns server contacts in email, im, web order


ServerMotd

internal string ServerMotd

Server message of the day (maximum 1000 chars)


ServerName

public string ServerName

Server name (maximum 200 chars)


ServerPort

internal int ServerPort

Port to use for webserver. Set to -1 for a random port


ServerThrottle

internal long ServerThrottle

A per-outgoing connection throttle rate (in bytes per second). Set to 0 for no throttling

Minimum 3KB/s (3072)


Video

internal string[] Video

Video file extensions

Method Detail

GetExtensionCategory

internal Naanou.Common.FileCategory GetExtensionCategory(string extension)

Case-insensitive checks if the extension is valid for indexing

Parameters:
extension -
Returns:

IConfigurationSectionHandler.Create

private object IConfigurationSectionHandler.Create(object parent,
                                                   object configContext,
                                                   System.Xml.XmlNode section)


Initialize

private void Initialize()


ReadSetting

internal string ReadSetting(System.Collections.Specialized.NameValueCollection settings,
                            string key,
                            string defaultValue)

Reads string setting

Parameters:
settings - Settings
key - Key
defaultValue - Default value
Returns:
Read setting, or default value

ReadSetting

internal int ReadSetting(System.Collections.Specialized.NameValueCollection settings,
                         string key,
                         int defaultValue)

Reads int setting

Parameters:
settings - Settings
key - Key
defaultValue - Default value
Returns:
Read setting, or default value

ReadSetting

internal long ReadSetting(System.Collections.Specialized.NameValueCollection settings,
                          string key,
                          long defaultValue)

Reads long setting

Parameters:
settings - Settings
key - Key
defaultValue - Default value
Returns:
Read setting, or default value

ReadSetting

internal bool ReadSetting(System.Collections.Specialized.NameValueCollection settings,
                          string key,
                          bool defaultValue)

Reads boolean setting

Parameters:
settings - Settings
key - Key
defaultValue - Default value
Returns:
Read setting, or default value

StripHTML

internal string StripHTML(string text)


ValidExtension

internal bool ValidExtension(string extension)

Case-insensitive checks if the extension is valid for indexing

Parameters:
extension -
Returns: