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

#import <SettingsRetriever.h>

Inheritance diagram for SettingsRetriever:
HttpRetriever ClassifierSettingsRetriever ScannerSettingsRetriever

Instance Methods

(BOOL) - setSettingsLoader:withError:
 
(BOOL) - retrieveToFileAndNotifyLoaderWithError:
 
(NSString *_Nullable) - retrieveToStringAndNotifyLoaderWithError:
 
- Instance Methods inherited from HttpRetriever
(NSString *_Nullable) - destinationFileWithError:
 
(BOOL) - setDestinationFile:withError:
 
(NSString *_Nullable) - urlStringWithError:
 
(BOOL) - retrieveToFileWithError:
 
(NSString *_Nullable) - retrieveToStringWithError:
 

Properties

NSInteger autoRetrieveInterval
 

Additional Inherited Members

- Class Methods inherited from HttpRetriever
(BOOL) + setHostName:withError:
 
(NSString *_Nullable) + hostNameWithError:
 
(BOOL) + setApiVersion:withError:
 
(NSString *_Nullable) + apiVersionWithError:
 
(BOOL) + setAccountId:withError:
 
(NSString *_Nullable) + accountIdWithError:
 
(BOOL) + setProjectId:withError:
 
(NSString *_Nullable) + projectIdWithError:
 
(BOOL) + setAuthenticationKey:withError:
 
(NSString *_Nullable) + authenticationKeyWithError:
 
(BOOL) + setApplicationId:withError:
 
(NSString *_Nullable) + applicationIdWithError:
 

Detailed Description

SettingsRetriever class is the specialized retriever which provides the means to download your settings.

Note
Do not initialize this class directly, it will crash at runtime. Use specific module settings retriever subclass instead.

Method Documentation

◆ retrieveToFileAndNotifyLoaderWithError:()

- (BOOL) retrieveToFileAndNotifyLoaderWithError: (NSError *_Nullable *_Nullable)  error

Retrieves settings to file and notifies settings loader to load it, if any was set.

Precondition
account ID, project ID, authentication key, application ID and destination file are set.
Remarks
Relevant errors: SENSITIVITYIO_ESETTINGS, ENETUNREACH, EPROTO, ENOENT, EIO
Parameters
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ retrieveToStringAndNotifyLoaderWithError:()

- (NSString * _Nullable) retrieveToStringAndNotifyLoaderWithError: (NSError *_Nullable *_Nullable)  error

Retrieves settings, notifies settings loader to load it, if any was set, and returns the settings string.

Precondition
account ID, project ID, authentication key, application ID are set.
Remarks
Relevant errors: SENSITIVITYIO_ESETTINGS, ENETUNREACH, EPROTO
Parameters
errorThe error representing the reason for the failure
Returns
The settings string on success, nil in case an error occured

◆ setSettingsLoader:withError:()

- (BOOL) setSettingsLoader: (SettingsLoader *_Nullable)  settingsLoader
withError: (NSError *_Nullable *_Nullable)  error 

Sets a settings loader that will be notified to load the downloaded settings when the retrieve&notify methods will be used.

Attention
A settings retriver takes ownership of the given settings loader and will relinquishing ownership of it when a new value is set or when the settings retriever itself is released.
Parameters
settingsLoaderThe settings loader to set for this retriever
errorThe error representing the reason for failing to set settings loader
Returns
True if setting the settings loader was successful, false in case an error occured

Property Documentation

◆ autoRetrieveInterval

- (NSInteger) autoRetrieveInterval
readwritenonatomicassign

autoRetrieveInterval in minutes. Default is -1, meaning auto-retrieve is disabled.

Precondition
account ID, project ID, authentication key, application ID and destination file are set.
Note
The retrieved settings will also be loaded if any settings loader was set

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