| 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_IOS_DOMAIN_HOST_INFO_H_ | 5 #ifndef REMOTING_IOS_DOMAIN_HOST_INFO_H_ |
| 6 #define REMOTING_IOS_DOMAIN_HOST_INFO_H_ | 6 #define REMOTING_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* hostOs; | 17 @property(nonatomic, copy) NSString* hostOs; |
| 18 @property(nonatomic, copy) NSString* hostOsVersion; | 18 @property(nonatomic, copy) NSString* hostOsVersion; |
| 19 @property(nonatomic, copy) NSString* hostVersion; | 19 @property(nonatomic, copy) NSString* hostVersion; |
| 20 @property(nonatomic, copy) NSString* jabberId; | 20 @property(nonatomic, copy) NSString* jabberId; |
| 21 @property(nonatomic, copy) NSString* kind; | 21 @property(nonatomic, copy) NSString* kind; |
| 22 @property(nonatomic, copy) NSString* publicKey; | 22 @property(nonatomic, copy) NSString* publicKey; |
| 23 @property(nonatomic, copy) NSString* status; | 23 @property(nonatomic, copy) NSString* status; |
| 24 @property(nonatomic, copy) NSDate* updatedTime; | 24 @property(nonatomic, copy) NSString* updatedTime; |
| 25 // True when |status| is @"ONLINE", anything else is False. | 25 // True when |status| is @"ONLINE", anything else is False. |
| 26 @property(nonatomic, readonly) bool isOnline; | 26 @property(nonatomic, readonly) bool isOnline; |
| 27 | 27 |
| 28 // Convert a json blob into a |HostInfo| object. Most useful for test. | 28 // Convert a json blob into a |HostInfo| object. Most useful for test. |
| 29 // TODO(nicholss): Might move this out into a catagory. | 29 // TODO(nicholss): Might move this out into a catagory. |
| 30 + (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data; | 30 + (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data; |
| 31 | 31 |
| 32 // First consider if |isOnline| is greater than anything else, then consider by | 32 // First consider if |isOnline| is greater than anything else, then consider by |
| 33 // case insensitive locale of |hostName|. | 33 // case insensitive locale of |hostName|. |
| 34 - (NSComparisonResult)compare:(HostInfo*)host; | 34 - (NSComparisonResult)compare:(HostInfo*)host; |
| 35 | 35 |
| 36 @end | 36 @end |
| 37 | 37 |
| 38 #endif // REMOTING_IOS_DOMAIN_HOST_INFO_H_ | 38 #endif // REMOTING_IOS_DOMAIN_HOST_INFO_H_ |
| OLD | NEW |