Provides information about one autoscan directory. More...
#include <autoscan.h>
Public Member Functions | |
| AutoscanDirectory () | |
| AutoscanDirectory (zmm::String location, scan_mode_t mode, scan_level_t level, bool recursive, bool persistent, int id=INVALID_SCAN_ID, unsigned int interval=0, bool hidden=false) | |
| Creates a new AutoscanDirectory object. | |
| void | setStorageID (int storageID) |
| int | getStorageID () |
| void | setLocation (zmm::String location) |
| The location can only be set once! | |
| zmm::String | getLocation () |
| scan_mode_t | getScanMode () |
| void | setScanMode (scan_mode_t mode) |
| scan_level_t | getScanLevel () |
| void | setScanLevel (scan_level_t level) |
| bool | getRecursive () |
| void | setHidden (bool hidden) |
| bool | getHidden () |
| void | setRecursive (bool recursive) |
| unsigned int | getInterval () |
| void | setInterval (unsigned int interval) |
| void | incTaskCount () |
| Increments the task count. | |
| void | decTaskCount () |
| int | getTaskCount () |
| void | setTaskCount (int taskCount) |
| void | setScanID (int id) |
| Sets the task ID. | |
| int | getScanID () |
| void | setObjectID (int id) |
| int | getObjectID () |
| bool | persistent () |
| void | setCurrentLMT (time_t lmt) |
| Sets the last modification time of the current ongoing scan. | |
| time_t | getPreviousLMT () |
| void | updateLMT () |
| void | resetLMT () |
| void | copyTo (zmm::Ref< AutoscanDirectory > copy) |
| copies all properties to another object | |
| zmm::Ref< zmm::Object > | getTimerParameter () |
| Set the parameter for timer notify that is associated with the particular autoscan directory. | |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::String | mapScanmode (scan_mode_t scanmode) |
| static scan_mode_t | remapScanmode (zmm::String scanmode) |
| static zmm::String | mapScanlevel (scan_level_t scanlevel) |
| static scan_level_t | remapScanlevel (zmm::String scanlevel) |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Attributes | |
| zmm::String | location |
| scan_mode_t | mode |
| scan_level_t | level |
| bool | recursive |
| bool | hidden |
| bool | persistent_flag |
| unsigned int | interval |
| int | taskCount |
| int | scanID |
| int | objectID |
| int | storageID |
| time_t | last_mod_previous_scan |
| time_t | last_mod_current_scan |
| zmm::Ref< zmm::Object > | timer_parameter |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
Provides information about one autoscan directory.
Definition at line 133 of file autoscan.h.
| AutoscanDirectory::AutoscanDirectory | ( | ) |
Definition at line 42 of file autoscan.cc.
References ContentManager::TimerParameter::IDAutoscan, INVALID_OBJECT_ID, INVALID_SCAN_ID, last_mod_current_scan, last_mod_previous_scan, objectID, storageID, taskCount, and timer_parameter.
| AutoscanDirectory::AutoscanDirectory | ( | zmm::String | location, | |
| scan_mode_t | mode, | |||
| scan_level_t | level, | |||
| bool | recursive, | |||
| bool | persistent, | |||
| int | id = INVALID_SCAN_ID, |
|||
| unsigned int | interval = 0, |
|||
| bool | hidden = false | |||
| ) |
Creates a new AutoscanDirectory object.
| location | autoscan path | |
| mode | scan mode | |
| level | scan level | |
| recursive | process directories recursively | |
| interval | rescan interval in seconds (only for timed scan mode) | |
| hidden | include hidden files zero means none. |
Definition at line 52 of file autoscan.cc.
References ContentManager::TimerParameter::IDAutoscan, INVALID_OBJECT_ID, INVALID_SCAN_ID, last_mod_current_scan, last_mod_previous_scan, objectID, persistent_flag, scanID, storageID, taskCount, and timer_parameter.
| void AutoscanDirectory::copyTo | ( | zmm::Ref< AutoscanDirectory > | copy | ) |
copies all properties to another object
Definition at line 426 of file autoscan.cc.
References hidden, interval, last_mod_current_scan, last_mod_previous_scan, level, location, mode, objectID, persistent_flag, recursive, scanID, storageID, taskCount, and timer_parameter.
| void AutoscanDirectory::decTaskCount | ( | ) | [inline] |
Definition at line 190 of file autoscan.h.
References taskCount.
| bool AutoscanDirectory::getHidden | ( | ) | [inline] |
Definition at line 172 of file autoscan.h.
References hidden.
| unsigned int AutoscanDirectory::getInterval | ( | ) | [inline] |
Definition at line 176 of file autoscan.h.
References interval.
| zmm::String AutoscanDirectory::getLocation | ( | ) | [inline] |
Definition at line 158 of file autoscan.h.
Referenced by WebAutoscanProcessListComparator().
| int AutoscanDirectory::getObjectID | ( | ) | [inline] |
Definition at line 207 of file autoscan.h.
References objectID.
| time_t AutoscanDirectory::getPreviousLMT | ( | ) | [inline] |
Definition at line 221 of file autoscan.h.
References last_mod_previous_scan.
| bool AutoscanDirectory::getRecursive | ( | ) | [inline] |
Definition at line 168 of file autoscan.h.
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| int AutoscanDirectory::getScanID | ( | ) | [inline] |
Definition at line 203 of file autoscan.h.
References scanID.
| scan_level_t AutoscanDirectory::getScanLevel | ( | ) | [inline] |
Definition at line 164 of file autoscan.h.
| scan_mode_t AutoscanDirectory::getScanMode | ( | ) | [inline] |
Definition at line 160 of file autoscan.h.
| int AutoscanDirectory::getStorageID | ( | ) | [inline] |
Definition at line 153 of file autoscan.h.
References storageID.
| int AutoscanDirectory::getTaskCount | ( | ) | [inline] |
Definition at line 192 of file autoscan.h.
References taskCount.
Set the parameter for timer notify that is associated with the particular autoscan directory.
Get the timer notify parameter associated with this directory.
Definition at line 451 of file autoscan.cc.
References timer_parameter.
| void AutoscanDirectory::incTaskCount | ( | ) | [inline] |
Increments the task count.
When recursive autoscan is in progress, we only want to subcribe to a timer event when the scan is finished. However, recursive scans spawn tasks for each directory. When adding a rescan task for subdirectories, the taskCount will be incremented. When a task is done the count will be decremented. When timer gets to zero, we will resubscribe.
Definition at line 188 of file autoscan.h.
References taskCount.
| String AutoscanDirectory::mapScanlevel | ( | scan_level_t | scanlevel | ) | [static] |
Definition at line 403 of file autoscan.cc.
References _, BasicScanLevel, FullScanLevel, and nil.
Referenced by SQLStorage::addAutoscanDirectory(), web::autoscan::autoscan2XML(), and SQLStorage::updateAutoscanDirectory().
| String AutoscanDirectory::mapScanmode | ( | scan_mode_t | scanmode | ) | [static] |
Definition at line 380 of file autoscan.cc.
References _, InotifyScanMode, nil, and TimedScanMode.
Referenced by SQLStorage::addAutoscanDirectory(), web::autoscan::autoscan2XML(), SQLStorage::getAutoscanList(), web::autoscan::process(), SQLStorage::updateAutoscanDirectory(), and SQLStorage::updateAutoscanPersistentList().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| bool AutoscanDirectory::persistent | ( | ) | [inline] |
Definition at line 209 of file autoscan.h.
References persistent_flag.
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| scan_level_t AutoscanDirectory::remapScanlevel | ( | zmm::String | scanlevel | ) | [static] |
Definition at line 416 of file autoscan.cc.
References _, _Exception, BasicScanLevel, and FullScanLevel.
Referenced by SQLStorage::_fillAutoscanDirectory(), and web::autoscan::process().
| scan_mode_t AutoscanDirectory::remapScanmode | ( | zmm::String | scanmode | ) | [static] |
Definition at line 393 of file autoscan.cc.
References _, _Exception, InotifyScanMode, and TimedScanMode.
Referenced by SQLStorage::_fillAutoscanDirectory(), and web::autoscan::process().
| void AutoscanDirectory::resetLMT | ( | ) | [inline] |
Definition at line 225 of file autoscan.h.
References last_mod_current_scan, and last_mod_previous_scan.
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| void AutoscanDirectory::setCurrentLMT | ( | time_t | lmt | ) |
Sets the last modification time of the current ongoing scan.
When doing a FullScan we look at modification times of the files. During the recursion of one AutoscanDirectory (which will be the starting point and which may have subcontainers) we must compare the last modification time of the starting point but we may not overwrite it until we are done. The time will be only set if it is higher than the previous value!
Definition at line 72 of file autoscan.cc.
References last_mod_current_scan.
| void AutoscanDirectory::setHidden | ( | bool | hidden | ) | [inline] |
Definition at line 170 of file autoscan.h.
| void AutoscanDirectory::setInterval | ( | unsigned int | interval | ) | [inline] |
Definition at line 178 of file autoscan.h.
| void AutoscanDirectory::setLocation | ( | zmm::String | location | ) |
The location can only be set once!
Definition at line 364 of file autoscan.cc.
References _, _Exception, and nil.
| void AutoscanDirectory::setObjectID | ( | int | id | ) | [inline] |
Definition at line 205 of file autoscan.h.
References objectID.
| void AutoscanDirectory::setRecursive | ( | bool | recursive | ) | [inline] |
Definition at line 174 of file autoscan.h.
| void AutoscanDirectory::setScanID | ( | int | id | ) |
Sets the task ID.
The task ID helps us to identify to which scan a particular task belongs. Recursive scans spawn new tasks - they all should have the same id.
Definition at line 373 of file autoscan.cc.
References RefCast, scanID, and timer_parameter.
| void AutoscanDirectory::setScanLevel | ( | scan_level_t | level | ) | [inline] |
Definition at line 166 of file autoscan.h.
| void AutoscanDirectory::setScanMode | ( | scan_mode_t | mode | ) | [inline] |
Definition at line 162 of file autoscan.h.
| void AutoscanDirectory::setStorageID | ( | int | storageID | ) | [inline] |
Definition at line 151 of file autoscan.h.
| void AutoscanDirectory::setTaskCount | ( | int | taskCount | ) | [inline] |
Definition at line 194 of file autoscan.h.
| void AutoscanDirectory::updateLMT | ( | ) | [inline] |
Definition at line 223 of file autoscan.h.
References last_mod_current_scan, and last_mod_previous_scan.
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
bool AutoscanDirectory::hidden [protected] |
Definition at line 250 of file autoscan.h.
Referenced by copyTo(), and getHidden().
unsigned int AutoscanDirectory::interval [protected] |
Definition at line 252 of file autoscan.h.
Referenced by copyTo(), and getInterval().
time_t AutoscanDirectory::last_mod_current_scan [protected] |
Definition at line 258 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), resetLMT(), setCurrentLMT(), and updateLMT().
time_t AutoscanDirectory::last_mod_previous_scan [protected] |
Definition at line 257 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), getPreviousLMT(), resetLMT(), and updateLMT().
scan_level_t AutoscanDirectory::level [protected] |
Definition at line 248 of file autoscan.h.
Referenced by copyTo().
zmm::String AutoscanDirectory::location [protected] |
Definition at line 246 of file autoscan.h.
Referenced by copyTo().
scan_mode_t AutoscanDirectory::mode [protected] |
Definition at line 247 of file autoscan.h.
Referenced by copyTo().
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
int AutoscanDirectory::objectID [protected] |
Definition at line 255 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), getObjectID(), and setObjectID().
bool AutoscanDirectory::persistent_flag [protected] |
Definition at line 251 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), and persistent().
bool AutoscanDirectory::recursive [protected] |
Definition at line 249 of file autoscan.h.
Referenced by copyTo().
int AutoscanDirectory::scanID [protected] |
Definition at line 254 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), getScanID(), and setScanID().
int AutoscanDirectory::storageID [protected] |
Definition at line 256 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), and getStorageID().
int AutoscanDirectory::taskCount [protected] |
Definition at line 253 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), decTaskCount(), getTaskCount(), and incTaskCount().
zmm::Ref<zmm::Object> AutoscanDirectory::timer_parameter [protected] |
Definition at line 259 of file autoscan.h.
Referenced by AutoscanDirectory(), copyTo(), getTimerParameter(), and setScanID().
1.6.1