ZDCPullManager

@interface ZDCPullManager : NSObject

The PullManager handles pulling changes down from the cloud.

The sync process can be broken down into 2 components: Push & Pull. If you’ve used git before, you’re already familiar with the process. You push changes (made locally) to the cloud. And you pull changes (made on remote devices) from the cloud.

This class handles the PULL side of things.

In particular, the PullManager will automatically keep the local treesystem information up-to-date with the cloud. This ONLY includes the treesystem metadata information, such as:

  • names of nodes
  • their permissions
  • their location within the tree

The ZeroDarkCloud framework doesn’t automatically download node data (the content your app generates). You are in complete control of that, which allows you to optimize for your app. For example, you can:

  • download only recent data
  • download data on demand (as the app needs it)
  • download a small part of what’s stored in the cloud (i.e. thumbnails instead of full images)
  • Performs a pull for the given {localUserID, treeID} tuple.

    Only one recursive pull per {localUserID, treeID} tuple is allowed at a time. So if this method is invoked multiple times for the same tuple, each spurious request (after the first) is ignored.

    Note

    You generally don’t ever have to invoke this method manually. The SyncManager takes care of this for each ZDCLocalUser in the database, paired with the registered ZeroDarkCloud.primaryTreeID.

    Declaration

    Objective-C

    - (void)pullRemoteChangesForLocalUserID:(NSString *)localUserID
                                     treeID:(NSString *)treeID;

    Swift

    func pullRemoteChanges(forLocalUserID localUserID: String!, treeID: String!)
  • Aborts an in-progress pull (if exists) for the given {localUserID, treeID} tuple.

    You may wish to do this when certain events occur. For example, if you’re deleting a localUser.

    Declaration

    Objective-C

    - (void)abortPullForLocalUserID:(NSString *)localUserID
                             treeID:(NSString *)treeID;

    Swift

    func abortPull(forLocalUserID localUserID: String!, treeID: String!)