Search in sources :

Example 1 with AuthWindow

use of org.opennms.features.topology.ssh.internal.AuthWindow in project opennms by OpenNMS.

the class SSHOperation method execute.

@Override
public Undoer execute(final List<VertexRef> targets, final OperationContext operationContext) {
    String ipAddr = "";
    int port = 22;
    if (targets != null) {
        for (final VertexRef target : targets) {
            final Item vertexItem = operationContext.getGraphContainer().getBaseTopology().getVertex(target, operationContext.getGraphContainer().getCriteria()).getItem();
            if (vertexItem != null) {
                final Property<String> ipAddrProperty = vertexItem.getItemProperty("ipAddr");
                ipAddr = ipAddrProperty == null ? "" : (String) ipAddrProperty.getValue();
                //Property portProperty = operationContext.getGraphContainer().getVertexItem(target).getItemProperty("port");
                //portProperty == null ? -1 : (Integer) portProperty.getValue();
                port = 22;
            }
        }
    }
    operationContext.getMainWindow().addWindow(new AuthWindow(ipAddr, port));
    return null;
}
Also used : Item(com.vaadin.data.Item) AuthWindow(org.opennms.features.topology.ssh.internal.AuthWindow) VertexRef(org.opennms.features.topology.api.topo.VertexRef)

Aggregations

Item (com.vaadin.data.Item)1 VertexRef (org.opennms.features.topology.api.topo.VertexRef)1 AuthWindow (org.opennms.features.topology.ssh.internal.AuthWindow)1