| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ | 5 #ifndef REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ |
| 6 #define REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ | 6 #define REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 // A detail record for a Remoting Host. | 10 // A detail record for a Remoting Host. |
| 11 @interface HostInfo : NSObject | 11 @interface HostInfo : NSObject |
| 12 | 12 |
| 13 // Various properties of the Remoting Host. | 13 // Various properties of the Remoting Host. |
| 14 @property(nonatomic, copy) NSString* createdTime; | 14 @property(nonatomic, copy) NSString* createdTime; |
| 15 @property(nonatomic, copy) NSString* hostId; | 15 @property(nonatomic, copy) NSString* hostId; |
| 16 @property(nonatomic, copy) NSString* hostName; | 16 @property(nonatomic, copy) NSString* hostName; |
| 17 @property(nonatomic, copy) NSString* hostVersion; | 17 @property(nonatomic, copy) NSString* hostVersion; |
| 18 @property(nonatomic, copy) NSString* jabberId; | 18 @property(nonatomic, copy) NSString* jabberId; |
| 19 @property(nonatomic, copy) NSString* kind; | 19 @property(nonatomic, copy) NSString* kind; |
| 20 @property(nonatomic, copy) NSString* publicKey; | 20 @property(nonatomic, copy) NSString* publicKey; |
| 21 @property(nonatomic, copy) NSString* status; | 21 @property(nonatomic, copy) NSString* status; |
| 22 @property(nonatomic, copy) NSDate* updatedTime; | 22 @property(nonatomic, copy) NSDate* updatedTime; |
| 23 // True when |status| is @"ONLINE", anything else is False. | 23 // True when |status| is @"ONLINE", anything else is False. |
| 24 @property(nonatomic, readonly) bool isOnline; | 24 @property(nonatomic, readonly) bool isOnline; |
| 25 | 25 |
| 26 // Convert a json blob into a |HostInfo| object. Most useful for test. |
| 27 // TODO(nicholss): Might move this out into a catagory. |
| 26 + (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data; | 28 + (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data; |
| 27 | 29 |
| 28 // First consider if |isOnline| is greater than anything else, then consider by | 30 // First consider if |isOnline| is greater than anything else, then consider by |
| 29 // case insensitive locale of |hostName|. | 31 // case insensitive locale of |hostName|. |
| 30 - (NSComparisonResult)compare:(HostInfo*)host; | 32 - (NSComparisonResult)compare:(HostInfo*)host; |
| 31 | 33 |
| 32 @end | 34 @end |
| 33 | 35 |
| 34 #endif // REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ | 36 #endif // REMOTING_CLIENT_IOS_DOMAIN_HOST_INFO_H_ |
| OLD | NEW |