sensitivity.io for iOS & macOS  1.1.4
Instance Methods | List of all members
ScannerExecutor Class Reference

#import <ScannerExecutor.h>

Inheritance diagram for ScannerExecutor:

Instance Methods

(instancetype _Nullable) - initWithError:
 
(ThreadPool *_Nullable) - threadPoolWithError:
 
(ThreatHandlerFuture *_Nullable) - scanString:withThreatHandler:withPriotiry:withError:
 
(ThreatHandlerFuture *_Nullable) - scanData:withThreatHandler:fileName:withPriotiry:withError:
 
(ThreatHandlerFuture *_Nullable) - scanFileAtPath:withThreatHandler:withPriotiry:withError:
 
(ThreatInfosFuture *_Nullable) - scanString:stopAtFirstThreat:withPriotiry:withError:
 
(ThreatInfosFuture *_Nullable) - scanData:stopAtFirstThreat:fileName:withPriotiry:withError:
 
(ThreatInfosFuture *_Nullable) - scanFileAtPath:stopAtFirstThreat:withPriotiry:withError:
 

Detailed Description

ScannerExecutor class provides the means to scan multiple texts, data and files simultaneously. Before performing any scans the scanner module needs to have its resources initialized, the license needs to be loaded, the scanner executor needs to be registered with a settings loader and the settings need to be loaded.

Method Documentation

◆ initWithError:()

- (instancetype _Nullable) initWithError: (NSError *_Nullable *_Nullable)  error

Initializes a new object immediately after memory for it has been allocated

Note
The designated initializer
Parameters
errorThe error representing the reason for the failure
Returns
The initialized object

◆ scanData:stopAtFirstThreat:fileName:withPriotiry:withError:()

- (ThreatInfosFuture* _Nullable) scanData: (NSData *_Nonnull)  data
stopAtFirstThreat: (BOOL)  stopAtFirst
fileName: (NSString *_Nullable)  fileName
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans data for threats.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, ECANCELED, EIO
Parameters
dataThe data that needs to be scanned
stopAtFirstIf true, the scan will stop on first found threat, otherwise it will scan the whole data
fileNameIf data is the content of a file, pass file name (otherwise it may be nil or empty string)
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this scan's status and threat results or nil in case an error occured

◆ scanData:withThreatHandler:fileName:withPriotiry:withError:()

- (ThreatHandlerFuture* _Nullable) scanData: (NSData *_Nonnull)  data
withThreatHandler: (ThreatHandler *_Nonnull)  threatHandler
fileName: (NSString *_Nullable)  fileName
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans data for threats using threat handler.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, ECANCELED, EIO
Parameters
dataThe data that needs to be scanned
threatHandlerThe threat handler
fileNameIf data is the content of a file, pass file name (otherwise it may be nil or empty string)
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat handler future which allows you to monitor this scan's status or nil in case an error occured

◆ scanFileAtPath:stopAtFirstThreat:withPriotiry:withError:()

- (ThreatInfosFuture* _Nullable) scanFileAtPath: (NSString *_Nonnull)  filePath
stopAtFirstThreat: (BOOL)  stopAtFirst
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans file for threats.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, ECANCELED, ENOENT, EIO
Parameters
filePathThe path of the file that needs to be scanned
stopAtFirstIf true, the scan will stop on first found threat, otherwise it will scan the whole file
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this scan's status and threat results or nil in case an error occured

◆ scanFileAtPath:withThreatHandler:withPriotiry:withError:()

- (ThreatHandlerFuture* _Nullable) scanFileAtPath: (NSString *_Nonnull)  filePath
withThreatHandler: (ThreatHandler *_Nonnull)  threatHandler
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans file for threats using threat handler.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, ECANCELED, ENOENT, EIO
Parameters
filePathThe path of the file that needs to be scanned
threatHandlerThe threat handler
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat handler future which allows you to monitor this scan's status or nil in case an error occured

◆ scanString:stopAtFirstThreat:withPriotiry:withError:()

- (ThreatInfosFuture* _Nullable) scanString: (NSString *_Nonnull)  text
stopAtFirstThreat: (BOOL)  stopAtFirst
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans provided text for threats.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, ECANCELED, EIO
Parameters
textThe text to scan
stopAtFirstIf true, the scan will stop on first found threat, otherwise it will scan the whole string
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this scan's status and threat results or nil in case an error occured

◆ scanString:withThreatHandler:withPriotiry:withError:()

- (ThreatHandlerFuture* _Nullable) scanString: (NSString *_Nonnull)  text
withThreatHandler: (ThreatHandler *_Nonnull)  threatHandler
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Scans provided text for threats using threat handler.

Precondition
Module resources initialized, valid license and settings, at least one license feature and settings criteria is enabled.
Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, ECANCELED, EIO
Parameters
textThe text to scan
threatHandlerThe threat handler
priorityThe priority of this scan. High priority scans execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat handler future which allows you to monitor this scan's status or nil in case an error occured

◆ threadPoolWithError:()

- (ThreadPool* _Nullable) threadPoolWithError: (NSError *_Nullable *_Nullable)  error

Returns the scanner executor thread pool

Attention
A scanner executor is responsible for creating it's thread pool and for relinquishing ownership of it when the scanner executor itself is released.
Parameters
errorThe error representing the reason for the failure
Returns
The scanner executor thread pool or nil in case an error occured

The documentation for this class was generated from the following file: