|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Manages the relationship between resources (files) on disk, a database which keeps track of these and Naanou which then indexes these resources.
Field Summary | |
---|---|
int |
Count
Debug var, number of resources added on last insert |
Naanou.ResourceExchange.ResourceExchanger | exchange |
System.Collections.ArrayList | fileWatchers |
bool | inited |
Naanou.ResourceExchange.IKeyStorage | keyStorer |
Naanou.Common.ILogger | logger |
Naanou.Common.WorkPool | pool |
Naanou.Common.Search.SearchDelegate | SearchDelegate |
string | UserId |
Constructor Summary | |
---|---|
ResourceManager() Initializes a new instance of the ResourceManager class. |
Property Summary | |
---|---|
Naanou.ResourceExchange.ResourceExchanger |
Exchange
Gets the exchanger |
int |
KeyLifetime
Lifetime (in minutes) for keys |
Naanou.ResourceExchange.IKeyStorage | KeyStorer |
Naanou.Common.ILogger | Logger |
Method Summary | |
---|---|
void | AddDirectory(System.IO.DirectoryInfo di, bool recursive, bool threadPool) |
void | AddFile(string fullPath, bool threadPool) |
void | AddFile(System.IO.FileInfo file, bool threadPool) |
void |
Close() Shuts everything down nicely |
Naanou.ResourceExchange.Entry |
GetEntryFromHashSerial(string hashSerial) Gets a resource from its content hash |
Naanou.ResourceExchange.Entry |
GetEntryFromPath(string path) Gets a resource from its full path |
void |
Init(Naanou.Common.ILogger log, Naanou.ResourceExchange.IKeyStorage keyStore, string userId, string bindAddress, Naanou.Common.Search.SearchDelegate searchDel) Initialises ResourceManager. If already inited, will re-init. |
void |
InitExchange() Initialises |
bool | IsShared(string path) |
void | Log(string msg, Naanou.Common.LogLevel level) |
void | Log(string message) |
void | RefreshLoopThread() |
void |
RemoveAll() Remove all resources |
void |
SharePath(string path, string descr, bool recursive, bool threadPool) Shares a path. Queues indexing of metadata for path and shares path. |
void |
SharePath(string path, string descr, bool recursive, bool serverMount, bool threadPool) Shares a path. Queues indexing of metadata for path and shares path. |
void |
UnSharePath(Naanou.ResourceExchange.ResourceExchanger.SharedMount mount) Removes a mount. Path must end in trailing slash if it is a directory |
void |
UnSharePath(string path, bool recursive) Unshares a path |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Event Summary | |
---|---|
Naanou.ResourceExchange.AddedEventHandler |
Added
A resource has been added |
System.EventHandler |
Cleared
All resources have been cleared |
Naanou.ResourceExchange.RemovedEventHandler |
Removed
A resource has been removed |
Field Detail |
---|
internal int Count
Debug var, number of resources added on last insert
private Naanou.ResourceExchange.ResourceExchanger exchange
private System.Collections.ArrayList fileWatchers
private bool inited
private Naanou.ResourceExchange.IKeyStorage keyStorer
private Naanou.Common.ILogger logger
private Naanou.Common.WorkPool pool
internal Naanou.Common.Search.SearchDelegate SearchDelegate
internal string UserId
Constructor Detail |
---|
private ResourceManager()
Initializes a new instance of the ResourceManager class.
Property Detail |
---|
public Naanou.ResourceExchange.ResourceExchanger Exchange
Gets the exchanger
internal int KeyLifetime
Lifetime (in minutes) for keys
internal Naanou.ResourceExchange.IKeyStorage KeyStorer
public Naanou.Common.ILogger Logger
Method Detail |
---|
private void AddDirectory(System.IO.DirectoryInfo di, bool recursive, bool threadPool)
private void AddFile(string fullPath, bool threadPool)
private void AddFile(System.IO.FileInfo file, bool threadPool)
public void Close()
Shuts everything down nicely
internal Naanou.ResourceExchange.Entry GetEntryFromHashSerial(string hashSerial)
Gets a resource from its content hash
Parameters:
hashSerial
- Hash serialinternal Naanou.ResourceExchange.Entry GetEntryFromPath(string path)
Gets a resource from its full path
Parameters:
path
- Full pathpublic void Init(Naanou.Common.ILogger log, Naanou.ResourceExchange.IKeyStorage keyStore, string userId, string bindAddress, Naanou.Common.Search.SearchDelegate searchDel)
Initialises ResourceManager. If already inited, will re-init.
Parameters:
log
- keyStore
- private void InitExchange()
Initialises
public bool IsShared(string path)
internal void Log(string msg, Naanou.Common.LogLevel level)
internal void Log(string message)
private void RefreshLoopThread()
internal void RemoveAll()
Remove all resources
public void SharePath(string path, string descr, bool recursive, bool threadPool)
Shares a path. Queues indexing of metadata for path and shares path.
Parameters:
path
- Path to adddescr
- Description for mount (can be null)recursive
- Should all subdirectories be added alsopublic void SharePath(string path, string descr, bool recursive, bool serverMount, bool threadPool)
Shares a path. Queues indexing of metadata for path and shares path.
Parameters:
path
- Path to adddescr
- Description for mount (can be null)recursive
- Should all subdirectories be added alsoserverMount
- If set to true, path will be mounted in server (set to false when sharing a path under an existing shared path)public void UnSharePath(Naanou.ResourceExchange.ResourceExchanger.SharedMount mount)
Removes a mount. Path must end in trailing slash if it is a directory
Parameters:
mount
- Mount to removeinternal void UnSharePath(string path, bool recursive)
Unshares a path
Parameters:
path
- Pathrecursive
- Recursive removeEvent Detail |
---|
internal Naanou.ResourceExchange.AddedEventHandler Added
A resource has been added
internal System.EventHandler Cleared
All resources have been cleared
internal Naanou.ResourceExchange.RemovedEventHandler Removed
A resource has been removed
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |