- /*
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
- package javax.mail.event;
-
- import java.util.*;
- import javax.mail.*;
-
- /**
- * This class models Message change events.
- *
- * @author John Mani
- */
-
- public class MessageChangedEvent extends MailEvent {
-
- /** The message's flags changed. */
- public static final int FLAGS_CHANGED = 1;
- /** The message's envelope (headers, but not body) changed. */
- public static final int ENVELOPE_CHANGED = 2;
-
- /**
- * The event type.
- *
- * @serial
- */
- protected int type;
-
- /**
- * The message that changed.
- */
- transient protected Message msg;
-
- /**
- * Constructor.
- * @param source The folder that owns the message
- * @param type The change type
- * @param msg The changed message
- */
- public MessageChangedEvent(Object source, int type, Message msg) {
- super(source);
- this.msg = msg;
- this.type = type;
- }
-
- /**
- * Return the type of this event.
- * @return type
- */
- public int getMessageChangeType() {
- return type;
- }
-
- /**
- * Return the changed Message.
- * @return the message
- */
- public Message getMessage() {
- return msg;
- }
-
- /**
- * Invokes the appropriate MessageChangedListener method.
- */
- public void dispatch(Object listener) {
- ((MessageChangedListener)listener).messageChanged(this);
- }
- }