KNYSync Class Reference
| Inherits from | NSObject |
| Declared in | KNYSync.h |
Tasks
-
– init -
syncEventDelegateproperty -
backgroundTransferCompletionHandlerproperty -
+ sharedInstance -
– initSync -
– initSyncInBackground: -
– initSyncWithPassPhrase: -
– initSyncWithPassPhrase:inBackGround: -
– startSessionInBackground -
– resetSync -
– resetSyncInBackground: -
– setServerURL: -
– setServerURL:portNumber: -
– setServerURL:portNumber:isSecure: -
– setUserId: -
– setPassword: -
– setAppId: -
– setAuthToken: -
– setDownloadBatchSize: -
– setUploadBatchSize: -
– setSyncOptions: -
– resetSyncOptions -
+ storeableDateFormat: -
– hasDateFormatter -
– setDateFormat: -
– dateFromString: -
– stringFromDate: -
– isUpgradeRequiredInBackground -
– performUpgradeInBackground -
– registerCompletionHandler:forSessionIdentifier: -
– removeCompletionHandlerForSession: -
– setDeviceId: -
– setSyncServiceEndPoint:
Properties
Class Methods
sharedInstance
Creates and returns instance of KNYSync.
+ (instancetype)sharedInstanceReturn Value
returns an instance of KNYSync.
Discussion
Creates and returns instance of KNYSync.
Declared In
KNYSync.hstoreableDateFormat:
Generate an NSDateFormatter.
+ (NSDateFormatter *)storeableDateFormat:(NSString *)formatParameters
- format
A valid NSDateFormatter format string.
Return Value
A NSDateFormatter that can be used for converting dates to strings and vice versa.
Discussion
Generate an NSDateFormatter.
Use this method to generate values to set the dateFormat property.
Declared In
KNYSync.hInstance Methods
dateFromString:
Convert the supplied NSString to NSDate, using the current database formatter.
- (NSDate *)dateFromString:(NSString *)sParameters
- s
NSStringto convert toNSDate.
Return Value
nil if no formatter is set.
Discussion
Convert the supplied NSString to NSDate, using the current database formatter.
Declared In
KNYSync.hhasDateFormatter
Test whether the database has a date formatter assigned.
- (BOOL)hasDateFormatterReturn Value
YES if there is a date formatter; NO if not.
Discussion
Test whether the database has a date formatter assigned.
Declared In
KNYSync.hinitSync
Initializes the sync.
- (void)initSyncDiscussion
Initializes the sync.
Exceptions
- KNYException
is Thrown, if any error occured during init process
Declared In
KNYSync.hinitSyncInBackground:
Initializes the sync in background.
- (void)initSyncInBackground:(KNYBooleanResultBlock)resultParameters
- a
block which of the format ^(BOOL succeeded, NSError *error);
Discussion
Initializes the sync in background.
Declared In
KNYSync.hinitSyncWithPassPhrase:
Initializes the sync.
- (void)initSyncWithPassPhrase:(NSString *)passPhraseParameters
- passPhrase
passPhrase for database encryption
Discussion
Initializes the sync.
Exceptions
- KNYException
is Thrown, if any error occured during init(with encryption)process
Declared In
KNYSync.hinitSyncWithPassPhrase:inBackGround:
Initializes the sync.
- (void)initSyncWithPassPhrase:(NSString *)passPhrase inBackGround:(KNYBooleanResultBlock)resultParameters
- passPhrase
passPhrase for database encryption
- a
block which of the format ^(BOOL succeeded, NSError *error);
Discussion
Initializes the sync.
Declared In
KNYSync.hisUpgradeRequiredInBackground
check whether sync upgrade is required from sync server
- (void)isUpgradeRequiredInBackgroundDiscussion
check whether sync upgrade is required from sync server
Declared In
KNYSync.hperformUpgradeInBackground
perform sync upgrade
- (void)performUpgradeInBackgroundDiscussion
perform sync upgrade
Declared In
KNYSync.hregisterCompletionHandler:forSessionIdentifier:
register the registerCompletion handler for each session identifier.
- (void)registerCompletionHandler:(id)completionHandler forSessionIdentifier:(NSString *)identifierParameters
- completionHandler
completionHandler for each sessionIdentfier.
- identifier
session identifier
Discussion
register the registerCompletion handler for each session identifier.
Declared In
KNYSync.hremoveCompletionHandlerForSession:
removeCompletionHandlerForSession.
- (void)removeCompletionHandlerForSession:(id)sessionParameters
- completionHandler
completionHandler corresponding a particular session.
- identifier
session identifier
Discussion
removeCompletionHandlerForSession.
Declared In
KNYSync.hresetSync
Reset the local device database.
- (void)resetSyncDiscussion
Reset the local device database.
Exceptions
- KNYException
is Thrown, if any error occured during sync reset process
Declared In
KNYSync.hresetSyncInBackground:
Reset the local device database.
- (void)resetSyncInBackground:(KNYBooleanResultBlock)resultParameters
- a
block which of the format ^(BOOL succeeded, NSError *error);
Discussion
Reset the local device database.
Declared In
KNYSync.hresetSyncOptions
Resets all sync options to their default values
- (void)resetSyncOptionsDiscussion
Resets all sync options to their default values
Exceptions
- KNYException
is Thrown, if any error occured
Declared In
KNYSync.hsetAppId:
Sets the appplication ID
- (void)setAppId:(NSString *)appIdParameters
- password
appId
Discussion
Sets the appplication ID
Exceptions
- KNYException
is Thrown, if any error occured during setAppId process
Declared In
KNYSync.hsetAuthToken:
Sets the auth token for the synchronization
- (void)setAuthToken:(NSString *)authTokenParameters
- authToken
authToken
Discussion
Sets the auth token for the synchronization
Exceptions
- KNYException
is Thrown, if any error occured during setAuthToken process
Declared In
KNYSync.hsetDateFormat:
Set to a date formatter to use string dates with sqlite instead of the default UNIX timestamps.
- (void)setDateFormat:(NSDateFormatter *)formatParameters
- format
Set to nil to use UNIX timestamps. Defaults to nil. Should be set using a formatter generated using KNYSync::storeableDateFormat.
Discussion
Set to a date formatter to use string dates with sqlite instead of the default UNIX timestamps.
Declared In
KNYSync.hsetDeviceId:
sets the setDevice ID @param deviceID
- (void)setDeviceId:(NSString *)deviceIdDiscussion
sets the setDevice ID @param deviceID
Declared In
KNYSync.hsetDownloadBatchSize:
Sets the download batch size
- (void)setDownloadBatchSize:(int)batchSizeParameters
- batchSize
download batchSize
Discussion
Sets the download batch size
Exceptions
- KNYException
is Thrown, if any error occured during setDownloadBatchSize process
Declared In
KNYSync.hsetPassword:
Sets the password for authenticating during synchronization.
- (void)setPassword:(NSString *)passwordParameters
- password
password
Discussion
Sets the password for authenticating during synchronization.
Exceptions
- KNYException
is Thrown, if any error occured during setPassword process
Declared In
KNYSync.hsetServerURL:
Sets the sync server URL without the port
- (void)setServerURL:(NSString *)urlParameters
- url
syncServerURL
Discussion
Sets the sync server URL without the port
Exceptions
- KNYException
is Thrown, if any error occured during setServerURL process
Declared In
KNYSync.hsetServerURL:portNumber:
Sets the sync server URL and port
- (void)setServerURL:(NSString *)url portNumber:(NSString *)portNumberParameters
- url
syncServerURL
- portNumber
portNumber
Discussion
Sets the sync server URL and port
Exceptions
- KNYException
is Thrown, if any error occured during setServerURLPortNumber process
Declared In
KNYSync.hsetServerURL:portNumber:isSecure:
Sets the sync server URL and port
- (void)setServerURL:(NSString *)url portNumber:(NSString *)portNumber isSecure:(BOOL)isSecureParameters
- url
syncServerURL
- portNumber
portNumber
- isSecure
if YES secure way of sending request to Sync server
Discussion
Sets the sync server URL and port
Exceptions
- KNYException
is Thrown, if any error occured during setServerURLPortNumberIsSecure process
Declared In
KNYSync.hsetSyncOptions:
Sets various sync options options
- (void)setSyncOptions:(KNYSyncOptions *)knySyncOptionsDiscussion
Sets various sync options options
Exceptions
- KNYException
is Thrown, if any error occured during setSyncOptions process
@param syncOptions
Declared In
KNYSync.hsetSyncServiceEndPoint:
sets the end point url for sync service
- (void)setSyncServiceEndPoint:(NSString *)URLStringParameters
- URLString
end point url
Discussion
sets the end point url for sync service
Declared In
KNYSync.hsetUploadBatchSize:
Sets the upload batch size
- (void)setUploadBatchSize:(int)batchSizeParameters
- batchSize
upload batchSize
Discussion
Sets the upload batch size
Exceptions
- KNYException
is Thrown, if any error occured during setUploadBatchSize process
Declared In
KNYSync.hsetUserId:
Sets the userid for authenticating during synchronization.
- (void)setUserId:(NSString *)userIdParameters
- userId
userId
Discussion
Sets the userid for authenticating during synchronization.
Exceptions
- KNYException
is Thrown, if any error occured during setUserId process
Declared In
KNYSync.hstartSessionInBackground
Start the sync process in background thread
- (void)startSessionInBackgroundDiscussion
Start the sync process in background thread
Exceptions
- KNYException
is Thrown, if sync session is already in progress.
Declared In
KNYSync.hstringFromDate:
Convert the supplied NSDate to NSString, using the current database formatter.
- (NSString *)stringFromDate:(NSDate *)dateParameters
- date
NSDateof date to convert toNSString.
Return Value
nil if no formatter is set.
Discussion
Convert the supplied NSDate to NSString, using the current database formatter.
Declared In
KNYSync.h