IOSAD-172 Rename internal constructor IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Fri, 26 Jun 2020 16:54:34 +0200
branchIOSAD-172
changeset 1474a37a548a6b3b
parent 1473 066dcbeeb6a0
child 1475 cf82c13266ac
IOSAD-172 Rename internal constructor
pEpObjCAdapter/PEPPassphraseCache.m
pEpObjCAdapter/PEPPassphraseCacheInternal.h
pEpObjCTests/PEPPassphraseCacheTest.m
     1.1 --- a/pEpObjCAdapter/PEPPassphraseCache.m	Fri Jun 26 16:54:34 2020 +0200
     1.2 +++ b/pEpObjCAdapter/PEPPassphraseCache.m	Fri Jun 26 16:54:34 2020 +0200
     1.3 @@ -14,7 +14,7 @@
     1.4  
     1.5  static NSUInteger s_maxNumberOfPassphrases = 20;
     1.6  static NSTimeInterval s_defaultTimeoutInSeconds = 10 * 60;
     1.7 -static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
     1.8 +static NSTimeInterval s_defaultCheckExpiryInterval = 60;
     1.9  
    1.10  @interface PEPPassphraseCache ()
    1.11  
    1.12 @@ -26,8 +26,8 @@
    1.13  @implementation PEPPassphraseCache
    1.14  
    1.15  /// Internal constructor (for now).
    1.16 -- (instancetype)initWithTimeout:(NSTimeInterval)timeout
    1.17 - removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval
    1.18 +- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
    1.19 +                      checkExpiryInterval:(NSTimeInterval)checkExpiryInterval
    1.20  {
    1.21      self = [super init];
    1.22      if (self) {
    1.23 @@ -41,9 +41,8 @@
    1.24  /// Public constructor with default values.
    1.25  - (instancetype)init
    1.26  {
    1.27 -    return [self
    1.28 -            initWithTimeout:s_defaultTimeoutInSeconds
    1.29 -            removeStalePassphrasesInterval:s_defaultRemoveStalePassphrasesInterval];
    1.30 +    return [self initWithPassphraseTimeout:s_defaultTimeoutInSeconds
    1.31 +                       checkExpiryInterval:s_defaultCheckExpiryInterval];
    1.32  }
    1.33  
    1.34  - (void)addPassphrase:(NSString *)passphrase
     2.1 --- a/pEpObjCAdapter/PEPPassphraseCacheInternal.h	Fri Jun 26 16:54:34 2020 +0200
     2.2 +++ b/pEpObjCAdapter/PEPPassphraseCacheInternal.h	Fri Jun 26 16:54:34 2020 +0200
     2.3 @@ -12,8 +12,8 @@
     2.4  
     2.5  @interface PEPPassphraseCache (internal)
     2.6  
     2.7 -- (instancetype)initWithTimeout:(NSTimeInterval)timeout
     2.8 - removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval;
     2.9 +- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
    2.10 +                      checkExpiryInterval:(NSTimeInterval)checkExpiryInterval;
    2.11  
    2.12  @end
    2.13  
     3.1 --- a/pEpObjCTests/PEPPassphraseCacheTest.m	Fri Jun 26 16:54:34 2020 +0200
     3.2 +++ b/pEpObjCTests/PEPPassphraseCacheTest.m	Fri Jun 26 16:54:34 2020 +0200
     3.3 @@ -91,8 +91,8 @@
     3.4  {
     3.5      NSTimeInterval timeout = 0.5;
     3.6      PEPPassphraseCache *ownCache = [[PEPPassphraseCache alloc]
     3.7 -                                    initWithTimeout:timeout
     3.8 -                                    removeStalePassphrasesInterval:timeout];
     3.9 +                                    initWithPassphraseTimeout:timeout
    3.10 +                                    checkExpiryInterval:timeout];
    3.11  
    3.12      NSString *ownPassphrase = @"blah";
    3.13      [ownCache addPassphrase:ownPassphrase];