Search in sources :

Example 1 with StatusInterface

use of org.opennms.web.svclayer.catstatus.model.StatusInterface in project opennms by OpenNMS.

the class CategoryBuilder method addOutageService.

/**
	 * <p>addOutageService</p>
	 *
	 * @param nodeId a int.
	 * @param interfaceIp a {@link java.lang.String} object.
	 * @param ipAddress a {@link java.lang.String} object.
	 * @param nodeLabel a {@link java.lang.String} object.
	 * @param service a {@link java.lang.String} object.
	 * @return a {@link org.opennms.web.svclayer.catstatus.support.CategoryBuilder} object.
	 */
public CategoryBuilder addOutageService(int nodeId, String interfaceIp, String ipAddress, String nodeLabel, String service) {
    StatusService statusService = new StatusService();
    addInterface(nodeId, interfaceIp, ipAddress, nodeLabel);
    StatusInterface intf = m_nodeAndInterfaceMap.get(getNodeAndInterfaceKey(nodeId, interfaceIp));
    statusService.setName(service);
    intf.addService(statusService);
    return this;
}
Also used : StatusService(org.opennms.web.svclayer.catstatus.model.StatusService) StatusInterface(org.opennms.web.svclayer.catstatus.model.StatusInterface)

Example 2 with StatusInterface

use of org.opennms.web.svclayer.catstatus.model.StatusInterface in project opennms by OpenNMS.

the class CategoryBuilder method addInterface.

/**
	 * <p>addInterface</p>
	 *
	 * @param nodeId a int.
	 * @param interfaceIp a {@link java.lang.String} object.
	 * @param ipAddress a {@link java.lang.String} object.
	 * @param nodeLabel a {@link java.lang.String} object.
	 * @return a {@link org.opennms.web.svclayer.catstatus.support.CategoryBuilder} object.
	 */
public CategoryBuilder addInterface(int nodeId, String interfaceIp, String ipAddress, String nodeLabel) {
    if (!m_nodeAndInterfaceMap.containsKey(getNodeAndInterfaceKey(nodeId, interfaceIp))) {
        addNode(nodeId, nodeLabel);
        StatusNode statusNode = m_nodeMap.get(nodeId);
        StatusInterface intf = new StatusInterface();
        intf.setIpAddress(ipAddress);
        statusNode.addIpInterface(intf);
        m_nodeAndInterfaceMap.put(getNodeAndInterfaceKey(nodeId, interfaceIp), intf);
    }
    return this;
}
Also used : StatusNode(org.opennms.web.svclayer.catstatus.model.StatusNode) StatusInterface(org.opennms.web.svclayer.catstatus.model.StatusInterface)

Aggregations

StatusInterface (org.opennms.web.svclayer.catstatus.model.StatusInterface)2 StatusNode (org.opennms.web.svclayer.catstatus.model.StatusNode)1 StatusService (org.opennms.web.svclayer.catstatus.model.StatusService)1