ReplicationConfiguration
public struct ReplicationConfiguration: ReplicationDetails
                Structure defining a Replication Configuration, to establish data syncing between an on-device database and a Predix Sync offline database service instance.
- 
                  
                  
Returns a pre-configured repeating and bi-directional replication configuration to the provided URL
Declaration
Swift
public static func repeatingBidirectionalReplication(with url: URL) -> ReplicationConfigurationParameters
urlURL of the Predix Sync server from which to replicate documents.
 - 
                  
                  
Returns a pre-configured one-time, bi-directional replication configuration to the provided URL
Declaration
Swift
public static func oneTimeBidirectionalReplication(with url: URL) -> ReplicationConfigurationParameters
urlURL of the Predix Sync server from which to replicate documents.
 - 
                  
                  
Returns a pre-configured one-time replication configuration for downloading changes from the server to the client from the provided URL
Declaration
Swift
public static func oneTimeServerToClientReplication(with url: URL) -> ReplicationConfigurationParameters
urlURL of the Predix Sync server from which to replicate documents.
 - 
                  
                  
Returns a pre-configured replication source configuration for downloading attachments from a previously sync’d database that specified
downloadsAttachmentsas false.Allows attachments to be downloaded indpendently of their source documents.
Declaration
Swift
public static func downloadAttachmentReplication(with url: URL, options: [String: Any] = [:]) -> ReplicationSourceParameters
urlURL of the Predix Sync server from which to download attachments.
 - 
                  
                  
Initializes a ReplicationConfiguration structure with the provided parameters. Defaults to a repeating, bi-directional configuration.
Declaration
Swift
public init(url: URL, isRepeating: Bool = true, isBidirectional: Bool = true, options: [String: Any] = [:], filterParameters: [String: Any]? = nil, limitToChannels: [String] = [])Parameters
urlURL to the Predix Sync offline database service instance
isRepeatingThis replication should be continous, or not.
isBidirectionalData replication should be both directions: client to server and server to client, or one-way: only server to client.
optionsAn optional JSON-compatible dictionary of additional advanced properties that can be used to tweak replication.
filterParametersOptional parameters sent to the
ReplicationFilterDelegateduring document evaluationlimitToChannelsA list of server-side defined channels.
 - 
                  
                  
URL to the Predix Sync offline database service instance
Declaration
Swift
public var url: URL - 
                  
                  
Indicates this replication should be continous, or not.
A continous replication continues until explicitly stopped, sending device changes to the service and receiving changes from the service until
stopReplication()is called, whereas a non-continous replication syncs data with the service instance once then automatically stops.Declaration
Swift
public var isRepeating: Bool - 
                  
                  
Indicates the data replication should be both directions: client to server and server to client, or one-way: only server to client.
Declaration
Swift
public var isBidirectional: Bool - 
                  
                  
Indicates the syncronization should include attachments.
Allows attachments to be downloaded indpendently of their source documents.
If attachments are not included, the document records will still be downloaded, and attachments can be downloaded later using the
Database.downloadAttachmentsmethod.Defaults to `true
Declaration
Swift
public var downloadsAttachments: Bool - 
                  
                  
An optional JSON-compatible dictionary of additional advanced properties that can be used to tweak replication.
Declaration
Swift
public var options: [String: Any] - 
                  
                  
Optional parameters sent to the
ReplicationFilterDelegateduring document evaluationDeclaration
Swift
public var filterParameters: [String: Any]? - 
                  
                  
A list of server-side defined channels. If this list is empty, then all documents in all channels the user has access to are sent to the client.
If this property contains a list of channels, then only documents in those channels are sent to the client.
Example:
User has access to
channel1,channel2, andchannel3channel1contains documents:docA, anddocBchannel2contains documents:docC, anddocDchannel3contains documents:docE, anddocFIf
limitToChannels = []then documentsdocA,docB,docC,docD,docE, anddocFare sent to the clientIf
limitToChannels = ["channel1", "channel3"]then documentsdocA,docB,docE, anddocFare sent to the clientIf
limitToChannels = ["channel4"]then no documents are sent to the client (since the user doesn’t have access tochannel4Declaration
Swift
public var limitToChannels: [String] - 
                  
                  
Returns a replication source configuration to download attachments based on the current configuration.
Used when
downloadsAttachmentsis falseDeclaration
Swift
public var downloadAttachmentReplication: ReplicationSource 
            View on GitHub
          
      ReplicationConfiguration Structure Reference