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