/*
* Copyright 2012 jMethods, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 com.myjavaworld.ftp;
import java.util.EventObject;
/**
* An event generated by objects of <code>ControlConnection</code>. This event
* is generated when ever a command is sent to the remote host or a reply is
* received from the remote host.
*
* @author Sai Pullabhotla, psai [at] jMethods [dot] com
* @version 2.0
*/
public class ControlConnectionEvent extends EventObject {
/**
* Serial version UID
*/
private static final long serialVersionUID = -7114487296458919376L;
/**
* The description of the event.
*/
private String message = null;
/**
* Constructs a <code>ControlConnectionEvent</code> object with the
* specified source and message.
*
* @param source
* The object that generated this event.
* @param message
* the description of the event.
*/
public ControlConnectionEvent(Object source, String message) {
super(source);
this.message = message;
}
/**
* Gets the descriptive message of this event.
*
* @return message Description of this event.
*/
public String getMessage() {
return message;
}
/**
* Converts this event object to a <code>String</code> and returns it.
*
* @return String representation of this event.
*/
@Override
public String toString() {
return message;
}
}