2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.mikrotik.internal.model;
15 import java.time.LocalDateTime;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.mikrotik.internal.util.Converter;
23 * The {@link RouterosL2TPCliInterface} is a model class for `l2tp-out` interface models having casting accessors for
24 * data that is specific to this network interface kind. Is a subclass of {@link RouterosInterfaceBase}.
26 * @author Oleg Vivtash - Initial contribution
29 public class RouterosL2TPCliInterface extends RouterosInterfaceBase {
30 public RouterosL2TPCliInterface(Map<String, String> props) {
35 public RouterosInterfaceType getDesignedType() {
36 return RouterosInterfaceType.L2TP_SERVER;
40 public String getApiType() {
45 public boolean hasDetailedReport() {
50 public boolean hasMonitor() {
54 public @Nullable String getStatus() {
55 return getProp("status");
58 public @Nullable String getEncoding() {
59 return String.format("Encoding: %s", getProp("encoding", "None"));
62 public @Nullable String getServerAddress() {
63 return getProp("connect-to");
66 public @Nullable String getLocalAddress() {
67 return getProp("local-address");
70 public @Nullable String getRemoteAddress() {
71 return getProp("remote-address");
74 public @Nullable String getUptime() {
75 return getProp("uptime");
78 public @Nullable LocalDateTime getUptimeStart() {
79 return Converter.routerosPeriodBack(getUptime());