- /*
- * 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 notifications from the Store connection. These
- * notifications can be ALERTS or NOTICES. ALERTS must be presented
- * to the user in a fashion that calls the user's attention to the
- * message.
- *
- * @author John Mani
- */
-
- public class StoreEvent extends MailEvent {
-
- /**
- * Indicates that this message is an ALERT.
- */
- public static final int ALERT = 1;
-
- /**
- * Indicates that this message is a NOTICE.
- */
- public static final int NOTICE = 2;
-
- /**
- * The event type.
- *
- * @serial
- */
- protected int type;
-
- /**
- * The message text to be presented to the user.
- *
- * @serial
- */
- protected String message;
-
- /**
- * Constructor.
- * @param source The source Store
- */
- public StoreEvent(Store store, int type, String message) {
- super(store);
- this.type = type;
- this.message = message;
- }
-
- /**
- * Return the type of this event.
- *
- * @return type
- * @see #ALERT
- * @see #NOTICE
- */
- public int getMessageType() {
- return type;
- }
-
- /**
- * Get the message from the Store.
- *
- * @return message from the Store
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Invokes the appropriate StoreListener method.
- */
- public void dispatch(Object listener) {
- ((StoreListener)listener).notification(this);
- }
- }