ADMRepo Class Reference
| Inherits from | NSObject |
| Declared in | ADMRepo.h |
Overview
ADMRepo allows the user to synchronously or asynchronously download versioned assets over the air. It uses the repository ID to form a manifest that holds the repository’s makeup and it downloads the file specified by the source URL.
Versioned assets are gzipped tarballs that have a version suffix to their name that corresponds to the current version found in the manifest JSON file. The remote server is responsible for properly configuring the manifest file and delivering the latest manifest file that corresponds to the existing tarballs in the remote asset repository. The tarballs can be archived using tar’s CLI tar -cvf files-1.tar.gz files/.
Automatic Content Loading
The user can create as many instances of ADMRepo as they prefer while specifying unique repository IDs. The user can choose whether or not to wait on the assets to download or let them operate on a background thread.
Tasks
Initializers
-
– initWithSourceURL:repoId:Initializes an
ADMRepoobject with the specified source URL and repository ID.
Updating Repo Contents
-
– updateAttempts to update the local repository in the iOS device to match the remote server configuration.
Accessing Repo Contents
-
– manifestDictionaryReturns the index.json manifest file in dictionary format.
-
– bundleIdsReturns the list of the bundle IDs from the manifest.
Accessing the Delegate
-
delegateThe receiver’s delegate.
property
Accessing Repo Attributes
-
repositoryIdThe name of the repository parent directory for all encompassing bundles.
property -
sourceURLThe remote source URL used to download the manifest files and tarballs if the cdnURL is not set.
property -
cdnURLAn optional CDN URL can be set to download the tarballs using this remote server address instead of the sourceURL. This is useful to separate the index.json manifest cache from the tarball caches when using a CDN.
property -
operationQueueThe operation queue which manages operations enqueued by the HTTP client.
property
Properties
cdnURL
An optional CDN URL can be set to download the tarballs using this remote server address instead of the sourceURL. This is useful to separate the index.json manifest cache from the tarball caches when using a CDN.
@property (strong, nonatomic) NSURL *cdnURLDiscussion
An optional CDN URL can be set to download the tarballs using this remote server address instead of the sourceURL. This is useful to separate the index.json manifest cache from the tarball caches when using a CDN.
Declared In
ADMRepo.hdelegate
The receiver’s delegate.
@property (weak, nonatomic) id<ADMRepoDelegate> delegateDiscussion
The receiver’s delegate.
@discussion A ADMRepo delegate responds to messages sent by download operations.
Declared In
ADMRepo.hoperationQueue
The operation queue which manages operations enqueued by the HTTP client.
@property (readonly, nonatomic) NSOperationQueue *operationQueueDiscussion
The operation queue which manages operations enqueued by the HTTP client.
Declared In
ADMRepo.hInstance Methods
bundleIds
Returns the list of the bundle IDs from the manifest.
- (NSArray *)bundleIdsReturn Value
An array of bundle IDs
Discussion
Returns the list of the bundle IDs from the manifest.
Declared In
ADMRepo.hinitWithSourceURL:repoId:
Initializes an ADMRepo object with the specified source URL and repository ID.
- (id)initWithSourceURL:(NSURL *)url repoId:(NSString *)repositoryIdParameters
- url
The remote source URL to download the manifest and asset tarballs. This argument must not be
nil.
- repositoryId
The name of the remote repository. This argument must not be
nil.
Return Value
The newly-initialized ADMClient or nil
Discussion
Initializes an ADMRepo object with the specified source URL and repository ID.
This is the designated initializer.
Declared In
ADMRepo.hmanifestDictionary
Returns the index.json manifest file in dictionary format.
- (NSDictionary *)manifestDictionaryReturn Value
The dictionary represetnation of the index.json manifest file
Discussion
Returns the index.json manifest file in dictionary format.
Declared In
ADMRepo.hupdate
Attempts to update the local repository in the iOS device to match the remote server configuration.
- (void)updateDiscussion
Attempts to update the local repository in the iOS device to match the remote server configuration.
It first checks the remote server manifest and checks for discrepencies among the local repository configuration if it exists. It then downloads only the necessary remote tarballs and extracts the archive in the Documents directory for bundle access.
Declared In
ADMRepo.h