]> git.basschouten.com Git - openhab-addons.git/blob
985282536f7a6ae1dc81bf433b2942d971ccff00
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.freebox.internal.api.model;
14
15 import java.util.List;
16
17 /**
18  * The {@link FreeboxLanHost} is the Java class used to map the "LanHost"
19  * structure used by the Lan Hosts Browser API
20  * https://dev.freebox.fr/sdk/os/lan/#lan-browser
21  *
22  * @author Laurent Garnier - Initial contribution
23  */
24 public class FreeboxLanHost {
25     private String id;
26     private String primaryName;
27     private String hostType;
28     private boolean primaryNameManual;
29     private FreeboxLanHostL2Ident l2ident;
30     private String vendorName;
31     private boolean persistent;
32     private boolean reachable;
33     private long lastTimeReachable;
34     private boolean active;
35     private long lastActivity;
36     private List<FreeboxLanHostName> names;
37     private List<FreeboxLanHostL3Connectivity> l3connectivities;
38
39     public String getMAC() {
40         return (l2ident != null && l2ident.isMacAddress()) ? l2ident.getId() : null;
41     }
42
43     public String getId() {
44         return id;
45     }
46
47     public String getPrimaryName() {
48         return primaryName;
49     }
50
51     public String getHostType() {
52         return hostType;
53     }
54
55     public boolean isPrimaryNameManual() {
56         return primaryNameManual;
57     }
58
59     public FreeboxLanHostL2Ident getL2Ident() {
60         return l2ident;
61     }
62
63     public String getVendorName() {
64         return vendorName;
65     }
66
67     public boolean isPersistent() {
68         return persistent;
69     }
70
71     public boolean isReachable() {
72         return reachable;
73     }
74
75     public long getLastTimeReachable() {
76         return lastTimeReachable;
77     }
78
79     public boolean isActive() {
80         return active;
81     }
82
83     public long getLastActivity() {
84         return lastActivity;
85     }
86
87     public List<FreeboxLanHostName> getNames() {
88         return names;
89     }
90
91     public List<FreeboxLanHostL3Connectivity> getL3Connectivities() {
92         return l3connectivities;
93     }
94 }