RLMSyncConfiguration.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 Realm Inc.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. ////////////////////////////////////////////////////////////////////////////
  18. #import <Foundation/Foundation.h>
  19. @class RLMSyncUser;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /**
  22. A configuration object representing configuration state for a Realm which is intended to sync with a Realm Object
  23. Server.
  24. */
  25. @interface RLMSyncConfiguration : NSObject
  26. /// The user to which the remote Realm belongs.
  27. @property (nonatomic, readonly) RLMSyncUser *user;
  28. /**
  29. The URL of the remote Realm upon the Realm Object Server.
  30. @warning The URL cannot end with `.realm`, `.realm.lock` or `.realm.management`.
  31. */
  32. @property (nonatomic, readonly) NSURL *realmURL;
  33. /**
  34. Whether SSL certificate validation is enabled for the connection associated
  35. with this configuration value. SSL certificate validation is ON by default.
  36. @warning NEVER disable certificate validation for clients and servers in production.
  37. */
  38. @property (nonatomic) BOOL enableSSLValidation;
  39. /**
  40. Create a sync configuration instance.
  41. @param user A `RLMSyncUser` that owns the Realm at the given URL.
  42. @param url The unresolved absolute URL to the Realm on the Realm Object Server, e.g.
  43. `realm://example.org/~/path/to/realm`. "Unresolved" means the path should
  44. contain the wildcard marker `~`, which will automatically be filled in with
  45. the user identity by the Realm Object Server.
  46. */
  47. - (instancetype)initWithUser:(RLMSyncUser *)user realmURL:(NSURL *)url;
  48. /// :nodoc:
  49. - (instancetype)init __attribute__((unavailable("This type cannot be created directly")));
  50. /// :nodoc:
  51. + (instancetype)new __attribute__((unavailable("This type cannot be created directly")));
  52. @end
  53. NS_ASSUME_NONNULL_END