Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions opennms-assemblies/xsds/src/license/THIRD-PARTY.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
avalon-framework--avalon-framework--4.1.5=apache_v1_1
com.hubspot--algebra--1.5=apache_v2
com.hubspot.immutables--hubspot-style--1.4=apache_v2
com.hubspot.immutables--immutable-collection-encodings--1.4=apache_v2
com.hubspot.immutables--immutables-exceptions--1.9=apache_v2
javax.transaction--jta--1.1=cddl_v1_1
xalan--serializer--2.7.3=apache_v2
xalan--xalan--2.7.3=apache_v2
4 changes: 4 additions & 0 deletions opennms-full-assembly/src/license/THIRD-PARTY.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ alt.dev.jmta--jmta--1.0=Raphael Szwarc Public Source License, Version 1.0
avalon-framework--avalon-framework--4.1.5=apache_v1_1
bsh--bsh--1.3.0=spl_v1_0
colt--colt--1.2.0=mit
com.hubspot--algebra--1.5=apache_v2
com.hubspot.immutables--hubspot-style--1.4=apache_v2
com.hubspot.immutables--immutable-collection-encodings--1.4=apache_v2
com.hubspot.immutables--immutables-exceptions--1.9=apache_v2
commons-discovery--commons-discovery--0.2=apache_v2
findbugs--annotations--1.0.0=lgpl_v2_1
jakarta-regexp--jakarta-regexp--1.4=apache_v2
Expand Down
37 changes: 37 additions & 0 deletions opennms-webapp-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,43 @@
<artifactId>org.opennms.core.config</artifactId>
<scope>${onmsLibScope}</scope>
</dependency>
<!-- Topology info-panel: render etc/infopanel Jinjava templates for the
topology Inspector (GET /api/v2/topology/infopanel). -->
<dependency>
<groupId>org.opennms.features.measurements</groupId>
<artifactId>org.opennms.features.measurements.api</artifactId>
<scope>${onmsLibScope}</scope>
</dependency>
<dependency>
<groupId>com.hubspot.jinjava</groupId>
<artifactId>jinjava</artifactId>
<version>2.8.3</version>
<exclusions>
<!-- Already provided by $OPENNMS_HOME/lib (same versions): bundling
copies in WEB-INF/lib breaks webapp startup with a classloader
constraint violation (e.g. ObjectMapper loaded by both loaders). -->
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</exclusion>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
<exclusion>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Licensed to The OpenNMS Group, Inc (TOG) under one or more
* contributor license agreements. See the LICENSE.md file
* distributed with this work for additional information
* regarding copyright ownership.
*
* TOG licenses this file to You under the GNU Affero General
* Public License Version 3 (the "License") or (at your option)
* any later version. You may not use this file except in
* compliance with the License. You may obtain a copy of the
* License at:
*
* https://www.gnu.org/licenses/agpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.opennms.web.rest.v2.infopanel;

import org.opennms.netmgt.model.OnmsNode;
import org.opennms.netmgt.model.OnmsSnmpInterface;

/**
* The {@code edge} variable for edge-scoped info-panel templates: the
* Vaadin-free counterpart of the legacy {@code LinkdEdge} the old map put
* into the template context. The legacy surface templates used --
* {@code edge.discoveredBy}, {@code edge.sourcePort.ifIndex},
* {@code edge.sourcePort.vertex} (the node) -- maps onto this shape as
* {@code edge.discoveredBy}, {@code edge.sourcePort.ifIndex} and
* {@code edge.sourcePort.node}.
*
* <p>Each side also exposes the resolved {@link OnmsSnmpInterface} (when the
* port name matches one), which is the identity that future link status /
* metrics work keys on as well -- extend here, not in a parallel model.
*/
public class EdgeInfo {

/** One endpoint of the edge: a node plus (optionally) a resolved port. */
public static class Port {
private final OnmsNode node;
private final String ifName;
private final OnmsSnmpInterface snmpInterface;

public Port(final OnmsNode node, final String ifName, final OnmsSnmpInterface snmpInterface) {
this.node = node;
this.ifName = ifName;
this.snmpInterface = snmpInterface;
}

public OnmsNode getNode() {
return node;
}

/** The port label persisted with the link (typically the ifName). */
public String getIfName() {
return ifName;
}

/** Resolved SNMP interface for the port name, or null when unmatched. */
public OnmsSnmpInterface getSnmpInterface() {
return snmpInterface;
}

/** Legacy-parity convenience ({@code LinkdPort.getIfIndex()}). */
public Integer getIfIndex() {
return snmpInterface != null ? snmpInterface.getIfIndex() : null;
}
}

private final String discoveredBy;
private final Port sourcePort;
private final Port targetPort;

public EdgeInfo(final String discoveredBy, final Port sourcePort, final Port targetPort) {
this.discoveredBy = discoveredBy;
this.sourcePort = sourcePort;
this.targetPort = targetPort;
}

/** Discovery protocol (lldp, cdp, ospf, isis, bridge), or null for drawn links. */
public String getDiscoveredBy() {
return discoveredBy;
}

public Port getSourcePort() {
return sourcePort;
}

public Port getTargetPort() {
return targetPort;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Licensed to The OpenNMS Group, Inc (TOG) under one or more
* contributor license agreements. See the LICENSE.md file
* distributed with this work for additional information
* regarding copyright ownership.
*
* TOG licenses this file to You under the GNU Affero General
* Public License Version 3 (the "License") or (at your option)
* any later version. You may not use this file except in
* compliance with the License. You may obtain a copy of the
* License at:
*
* https://www.gnu.org/licenses/agpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.opennms.web.rest.v2.infopanel;

import org.codehaus.jackson.annotate.JsonProperty;

/**
* One rendered info-panel item: a titled HTML fragment produced from an
* {@code etc/infopanel/} Jinjava template. {@code order} controls display
* sequence (ascending). The HTML is operator-authored; the consuming client is
* responsible for sanitizing it before injecting into the DOM.
*/
public class InfoPanelItem {

@JsonProperty("title")
private String title;

@JsonProperty("order")
private int order;

@JsonProperty("html")
private String html;

public InfoPanelItem() {
}

public InfoPanelItem(final String title, final int order, final String html) {
this.title = title;
this.order = order;
this.html = html;
}

public String getTitle() {
return title;
}

public void setTitle(final String title) {
this.title = title;
}

public int getOrder() {
return order;
}

public void setOrder(final int order) {
this.order = order;
}

public String getHtml() {
return html;
}

public void setHtml(final String html) {
this.html = html;
}
}
Loading
Loading