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;
}
Aggregations