]> git.basschouten.com Git - openhab-addons.git/blob
424ff28cee5f06d1981f5aa07f8cc70c471de496
[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.mikrotik.internal.model;
14
15 import java.time.LocalDateTime;
16 import java.util.Map;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.mikrotik.internal.util.Converter;
21
22 /**
23  * The {@link RouterosPPPoECliInterface} is a model class for `pppoe-out` interface models having casting accessors for
24  * data that is specific to this network interface kind. Is a subclass of {@link RouterosInterfaceBase}.
25  *
26  * @author Oleg Vivtash - Initial contribution
27  */
28 @NonNullByDefault
29 public class RouterosPPPoECliInterface extends RouterosInterfaceBase {
30     public RouterosPPPoECliInterface(Map<String, String> props) {
31         super(props);
32     }
33
34     @Override
35     public RouterosInterfaceType getDesignedType() {
36         return RouterosInterfaceType.PPPOE_CLIENT;
37     }
38
39     @Override
40     public String getApiType() {
41         return "pppoe-client";
42     }
43
44     @Override
45     public boolean hasDetailedReport() {
46         return false;
47     }
48
49     @Override
50     public boolean hasMonitor() {
51         return true;
52     }
53
54     @Override
55     public @Nullable String getMacAddress() {
56         return getProp("ac-mac");
57     }
58
59     public @Nullable String getStatus() {
60         return getProp("status");
61     }
62
63     public @Nullable String getUptime() {
64         return getProp("uptime");
65     }
66
67     public @Nullable LocalDateTime getUptimeStart() {
68         return Converter.routerosPeriodBack(getUptime());
69     }
70 }