OMCMobileResource Class Reference

Inherits from NSObject
Declared in OMCMobileResource.h

Overview

OMCMobileResource - Base class for all of the mobile resources

  uri

Uri of the resource

@property (nonatomic, readonly) NSString *uri

Declared In

OMCMobileResource.h

  lastSyncTime

lastSyncTime of the resource

@property (nonatomic, readonly) double lastSyncTime

Declared In

OMCMobileResource.h

  pinned

Resource’s pinned status

@property (nonatomic, readonly) BOOL pinned

Declared In

OMCMobileResource.h

  hasConflicts

Resource’s conflict status

@property (nonatomic, readonly) BOOL hasConflicts

Declared In

OMCMobileResource.h

  hasOfflineUpdates

Resource’s offline/local updates status

@property (nonatomic, readonly) BOOL hasOfflineUpdates

Declared In

OMCMobileResource.h

  hasOfflineCommitError

Resource’s error status after committing offline updates

@property (nonatomic, readonly) BOOL hasOfflineCommitError

Declared In

OMCMobileResource.h

– pinResource:

Pin the resource

- (NSError *)pinResource:(SyncPinPriority)pinPriority

Parameters

pinPriority

specifies the priority

Return Value

NSError* if resource not found, otherwise nil.

Declared In

OMCMobileResource.h

– unpinResource

  • Unpin the resource
- (NSError *)unpinResource

Return Value

NSError* if resource not found, otherwise nil.

Declared In

OMCMobileResource.h

– currentOfflineState

  • Resource’s current offline/local updated state, with specific information of which offline operation is pending, if any.
- (SyncOfflineState)currentOfflineState

Return Value

SyncOfflineState offline state

Declared In

OMCMobileResource.h

– setRequestHeaders:

Sets extra request headers. Afterwards, you need to call reloadResource from the service or SaveResource to use these extra request headers. No need to specify headers for authorization and content-type, since they will be added by default.

- (void)setRequestHeaders:(NSDictionary *)headers

Parameters

headers

Extra request headers

Declared In

OMCMobileResource.h

– getResponseHeaders

Returns response headers which have been retrieved from the server

- (NSDictionary *)getResponseHeaders

Return Value

NSDictionary* response headers

Declared In

OMCMobileResource.h

– setSyncPolicy:

Sets Sync Policy. Afterwards you need to call reloadResource or SaveResource to use this Sync Policy.

- (void)setSyncPolicy:(OMCSyncPolicy *)policy

Parameters

policy

OMCSyncPolicy object

Declared In

OMCMobileResource.h

– getCurrentSyncPolicy

Returns currently associated Sync Policy for this resource.

- (OMCSyncPolicy *)getCurrentSyncPolicy

Return Value

policy OMCSyncPolicy object

Declared In

OMCMobileResource.h

– reloadResource:

Reloads the data that was last downloaded from the service. Any offline updates are not discarded.

- (void)reloadResource:(OMCMobileResourceSuccess)successBlk

Parameters

successBlk

callback block for success

Declared In

OMCMobileResource.h

– reloadResource:reloadFromService:onSuccess:

Reloads the data that was last downloaded from the service. Can provide the ability to discard any offline updates for the resource or can go to the service if online to get the latest.

- (void)reloadResource:(BOOL)discardOfflineUpdates reloadFromService:(BOOL)reloadFromService onSuccess:(OMCMobileResourceSuccess)successBlk

Parameters

discardOfflineUpdates

If true will delete all offline updates from the cache.

reloadFromService

If true will reload from the service if online or from the cache if offline.

successBlk

callback block for success, will return the reloaded resource.

Declared In

OMCMobileResource.h