/*
 * @(#)SshDataReceivedEvent.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.ssh;

/**
 * Fired by Ssh instance when SSH server sends data to client.
 *
 * @author vglass
 */
public class SshDataReceivedEvent
        extends SshEvent {

    private char dataChar;

    /**
     * Creates a new SshDataReceivedEvent instance.
     *
     * @param source the source of the event
     * @param dataChar the data received from the Ssh server
     */
    public SshDataReceivedEvent(Ssh source, char dataChar) {
        super(source);
        this.dataChar = dataChar;
    }

    /**
     * Gets data received from the Ssh server.
     *
     * @return the data received
     */
    public String getData() {
        return Character.toString(this.dataChar);
    }

    public char getDataChar() {
        return this.dataChar;
    }

    @Override
    public void accept(SshListener listener) {
        listener.dataReceived(this);
    }
}
