You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ri...@apache.org on 2006/07/14 12:02:29 UTC

svn commit: r421852 [4/15] - in /geronimo/specs/trunk: ./ geronimo-spec-j2ee/ geronimo-spec-javamail-1.3.1/ geronimo-spec-javamail-1.3.1/src/ geronimo-spec-javamail-1.4/ geronimo-spec-javamail-1.4/src/ geronimo-spec-javamail-1.4/src/main/ geronimo-spec...

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,239 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class URLName {
+    private String file;
+    private String host;
+    private String password;
+    private int port;
+    private String protocol;
+    private String ref;
+    private String username;
+    protected String fullURL;
+    private int hashCode;
+
+    public URLName(String url) {
+        parseString(url);
+    }
+
+    protected void parseString(String url) {
+        URI uri;
+        try {
+            if (url == null) {
+                uri = null;
+            } else {
+                uri = new URI(url);
+            }
+        } catch (URISyntaxException e) {
+            uri = null;
+        }
+        if (uri == null) {
+            protocol = null;
+            host = null;
+            port = -1;
+            file = null;
+            ref = null;
+            username = null;
+            password = null;
+            return;
+        }
+
+        protocol = checkBlank(uri.getScheme());
+        host = checkBlank(uri.getHost());
+        port = uri.getPort();
+        file = checkBlank(uri.getPath());
+        ref = checkBlank(uri.getFragment());
+        String userInfo = checkBlank(uri.getUserInfo());
+        if (userInfo == null) {
+            username = null;
+            password = null;
+        } else {
+            int pos = userInfo.indexOf(':');
+            if (pos == -1) {
+                username = userInfo;
+                password = null;
+            } else {
+                username = userInfo.substring(0, pos);
+                password = userInfo.substring(pos + 1);
+            }
+        }
+        updateFullURL();
+    }
+
+    public URLName(String protocol, String host, int port, String file, String username, String password) {
+        this.protocol = checkBlank(protocol);
+        this.host = checkBlank(host);
+        this.port = port;
+        if (file == null || file.length() == 0) {
+            this.file = null;
+            ref = null;
+        } else {
+            int pos = file.indexOf('#');
+            if (pos == -1) {
+                this.file = file;
+                ref = null;
+            } else {
+                this.file = file.substring(0, pos);
+                ref = file.substring(pos + 1);
+            }
+        }
+        this.username = checkBlank(username);
+        if (this.username != null) {
+            this.password = checkBlank(password);
+        } else {
+            this.password = null;
+        }
+        updateFullURL();
+    }
+
+    public URLName(URL url) {
+        protocol = checkBlank(url.getProtocol());
+        host = checkBlank(url.getHost());
+        port = url.getPort();
+        file = checkBlank(url.getFile());
+        ref = checkBlank(url.getRef());
+        String userInfo = checkBlank(url.getUserInfo());
+        if (userInfo == null) {
+            username = null;
+            password = null;
+        } else {
+            int pos = userInfo.indexOf(':');
+            if (pos == -1) {
+                username = userInfo;
+                password = null;
+            } else {
+                username = userInfo.substring(0, pos);
+                password = userInfo.substring(pos + 1);
+            }
+        }
+        updateFullURL();
+    }
+
+    private static String checkBlank(String target) {
+        if (target == null || target.length() == 0) {
+            return null;
+        } else {
+            return target;
+        }
+    }
+
+    private void updateFullURL() {
+        hashCode = 0;
+        StringBuffer buf = new StringBuffer(100);
+        if (protocol != null) {
+            buf.append(protocol).append(':');
+            if (host != null) {
+                buf.append("//");
+                if (username != null) {
+                    buf.append(username);
+                    if (password != null) {
+                        buf.append(':').append(password);
+                    }
+                    buf.append('@');
+                }
+                buf.append(host);
+                if (port != -1) {
+                    buf.append(':').append(port);
+                }
+                if (file != null) {
+                    buf.append(file);
+                }
+                hashCode = buf.toString().hashCode();
+                if (ref != null) {
+                    buf.append('#').append(ref);
+                }
+            }
+        }
+        fullURL = buf.toString();
+    }
+
+    public boolean equals(Object o) {
+        if (o instanceof URLName == false) {
+            return false;
+        }
+        URLName other = (URLName) o;
+        // check same protocol - false if either is null
+        if (protocol == null || other.protocol == null || !protocol.equals(other.protocol)) {
+            return false;
+        }
+
+        if (port != other.port) {
+            return false;
+        }
+
+        // check host - false if not (both null or both equal)
+        return areSame(host, other.host) && areSame(file, other.file) && areSame(username, other.username) && areSame(password, other.password);
+    }
+
+    private static boolean areSame(String s1, String s2) {
+        if (s1 == null) {
+            return s2 == null;
+        } else {
+            return s1.equals(s2);
+        }
+    }
+
+    public int hashCode() {
+        return hashCode;
+    }
+
+    public String toString() {
+        return fullURL;
+    }
+
+    public String getFile() {
+        return file;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public String getRef() {
+        return ref;
+    }
+
+    public URL getURL() throws MalformedURLException {
+        return new URL(fullURL);
+    }
+
+    public String getUsername() {
+        return username;
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/URLName.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,35 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+/**
+ * An adaptor that receives connection events.
+ * This is a default implementation where the handlers perform no action.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ConnectionAdapter implements ConnectionListener {
+    public void closed(ConnectionEvent event) {
+    }
+
+    public void disconnected(ConnectionEvent event) {
+    }
+
+    public void opened(ConnectionEvent event) {
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,67 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ConnectionEvent extends MailEvent {
+    /**
+     * A connection was opened.
+     */
+    public static final int OPENED = 1;
+
+    /**
+     * A connection was disconnected.
+     */
+    public static final int DISCONNECTED = 2;
+
+    /**
+     * A connection was closed.
+     */
+    public static final int CLOSED = 3;
+
+    protected int type;
+
+    public ConnectionEvent(Object source, int type) {
+        super(source);
+        this.type = type;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void dispatch(Object listener) {
+        // assume that it is the right listener type
+        ConnectionListener l = (ConnectionListener) listener;
+        switch (type) {
+        case OPENED:
+            l.opened(this);
+            break;
+        case DISCONNECTED:
+            l.disconnected(this);
+            break;
+        case CLOSED:
+            l.closed(this);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid type " + type);
+        }
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,42 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * Listener for handling connection events.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ConnectionListener extends EventListener {
+    /**
+     * Called when a connection is opened.
+     */
+    public abstract void opened(ConnectionEvent event);
+
+    /**
+     * Called when a connection is disconnected.
+     */
+    public abstract void disconnected(ConnectionEvent event);
+
+    /**
+     * Called when a connection is closed.
+     */
+    public abstract void closed(ConnectionEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/ConnectionListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,35 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+/**
+ * An adaptor that receives connection events.
+ * This is a default implementation where the handlers perform no action.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class FolderAdapter implements FolderListener {
+    public void folderCreated(FolderEvent event) {
+    }
+
+    public void folderDeleted(FolderEvent event) {
+    }
+
+    public void folderRenamed(FolderEvent event) {
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,100 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import javax.mail.Folder;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class FolderEvent extends MailEvent {
+    public static final int CREATED = 1;
+    public static final int DELETED = 2;
+    public static final int RENAMED = 3;
+
+    protected transient Folder folder;
+    protected transient Folder newFolder;
+    protected int type;
+
+    /**
+     * Constructor used for RENAMED events.
+     *
+     * @param source the source of the event
+     * @param oldFolder the folder that was renamed
+     * @param newFolder the folder with the new name
+     * @param type the event type
+     */
+    public FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type) {
+        super(source);
+        folder = oldFolder;
+        this.newFolder = newFolder;
+        this.type = type;
+    }
+
+    /**
+     * Constructor other events.
+     *
+     * @param source the source of the event
+     * @param folder the folder affected
+     * @param type the event type
+     */
+    public FolderEvent(Object source, Folder folder, int type) {
+        this(source, folder, null, type);
+    }
+
+    public void dispatch(Object listener) {
+        FolderListener l = (FolderListener) listener;
+        switch (type) {
+        case CREATED:
+            l.folderCreated(this);
+            break;
+        case DELETED:
+            l.folderDeleted(this);
+            break;
+        case RENAMED:
+            l.folderRenamed(this);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid type " + type);
+        }
+    }
+
+    /**
+     * Return the affected folder.
+     * @return the affected folder
+     */
+    public Folder getFolder() {
+        return folder;
+    }
+
+    /**
+     * Return the new folder; only applicable to RENAMED events.
+     * @return the new folder
+     */
+    public Folder getNewFolder() {
+        return newFolder;
+    }
+
+    /**
+     * Return the event type.
+     * @return the event type
+     */
+    public int getType() {
+        return type;
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,31 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface FolderListener extends EventListener {
+    public abstract void folderCreated(FolderEvent event);
+
+    public abstract void folderDeleted(FolderEvent event);
+
+    public abstract void folderRenamed(FolderEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/FolderListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,33 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventObject;
+
+/**
+ * Common base class for mail events.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class MailEvent extends EventObject {
+    public MailEvent(Object source) {
+        super(source);
+    }
+
+    public abstract void dispatch(Object listener);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MailEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import javax.mail.Message;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MessageChangedEvent extends MailEvent {
+    /**
+     * The message's flags changed.
+     */
+    public static final int FLAGS_CHANGED = 1;
+
+    /**
+     * The messages envelope changed.
+     */
+    public static final int ENVELOPE_CHANGED = 2;
+
+    protected transient Message msg;
+    protected int type;
+
+    /**
+     * Constructor.
+     *
+     * @param source the folder that owns the message
+     * @param type the event type
+     * @param message the affected message
+     */
+    public MessageChangedEvent(Object source, int type, Message message) {
+        super(source);
+        msg = message;
+        this.type = type;
+    }
+
+    public void dispatch(Object listener) {
+        MessageChangedListener l = (MessageChangedListener) listener;
+        l.messageChanged(this);
+    }
+
+    /**
+     * Return the affected message.
+     * @return the affected message
+     */
+    public Message getMessage() {
+        return msg;
+    }
+
+    /**
+     * Return the type of change.
+     * @return the event type
+     */
+    public int getMessageChangeType() {
+        return type;
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,27 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface MessageChangedListener extends EventListener {
+    public abstract void messageChanged(MessageChangedEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageChangedListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,32 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+/**
+ * An adaptor that receives message count events.
+ * This is a default implementation where the handlers perform no action.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class MessageCountAdapter implements MessageCountListener {
+    public void messagesAdded(MessageCountEvent event) {
+    }
+
+    public void messagesRemoved(MessageCountEvent event) {
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,110 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import javax.mail.Folder;
+import javax.mail.Message;
+
+/**
+ * Event indicating a change in the number of messages in a folder.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MessageCountEvent extends MailEvent {
+    /**
+     * Messages were added to the folder.
+     */
+    public static final int ADDED = 1;
+
+    /**
+     * Messages were removed from the folder.
+     */
+    public static final int REMOVED = 2;
+
+    /**
+     * The affected messages.
+     */
+    protected transient Message msgs[];
+
+    /**
+     * The event type.
+     */
+    protected int type;
+
+    /**
+     * If true, then messages were expunged from the folder by this client
+     * and message numbers reflect the deletion; if false, then the change
+     * was the result of an expunge by a different client.
+     */
+    protected boolean removed;
+
+    /**
+     * Construct a new event.
+     *
+     * @param folder   the folder containing the messages
+     * @param type     the event type
+     * @param removed  indicator of whether messages were expunged by this client
+     * @param messages the affected messages
+     */
+    public MessageCountEvent(Folder folder, int type, boolean removed, Message messages[]) {
+        super(folder);
+        this.msgs = messages;
+        this.type = type;
+        this.removed = removed;
+    }
+
+    /**
+     * Return the event type.
+     *
+     * @return the event type
+     */
+    public int getType() {
+        return type;
+    }
+
+    /**
+     * @return whether this event was the result of an expunge by this client
+     * @see MessageCountEvent#removed
+     */
+    public boolean isRemoved() {
+        return removed;
+    }
+
+    /**
+     * Return the affected messages.
+     *
+     * @return the affected messages
+     */
+    public Message[] getMessages() {
+        return msgs;
+    }
+
+    public void dispatch(Object listener) {
+        MessageCountListener l = (MessageCountListener) listener;
+        switch (type) {
+        case ADDED:
+            l.messagesAdded(this);
+            break;
+        case REMOVED:
+            l.messagesRemoved(this);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid type " + type);
+        }
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface MessageCountListener extends EventListener {
+    public abstract void messagesAdded(MessageCountEvent event);
+
+    public abstract void messagesRemoved(MessageCountEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/MessageCountListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,82 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import javax.mail.Store;
+
+/**
+ * Event representing motifications from the Store connection.
+ *
+ * @version $Rev$ $Date$
+ */
+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 message type.
+     */
+    protected int type;
+
+    /**
+     * The text to be presented to the user.
+     */
+    protected String message;
+
+    /**
+     * Construct a new event.
+     *
+     * @param store   the Store that initiated the notification
+     * @param type    the message type
+     * @param message the text to be presented to the user
+     */
+    public StoreEvent(Store store, int type, String message) {
+        super(store);
+        this.type = type;
+        this.message = message;
+    }
+
+    /**
+     * Return the message type.
+     *
+     * @return the message type
+     */
+    public int getMessageType() {
+        return type;
+    }
+
+    /**
+     * Return the text to be displayed to the user.
+     *
+     * @return the text to be displayed to the user
+     */
+    public String getMessage() {
+        return message;
+    }
+
+    public void dispatch(Object listener) {
+        ((StoreListener) listener).notification(this);
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,27 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface StoreListener extends EventListener {
+    public abstract void notification(StoreEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/StoreListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,35 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+/**
+ * An adaptor that receives transport events.
+ * This is a default implementation where the handlers perform no action.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class TransportAdapter implements TransportListener {
+    public void messageDelivered(TransportEvent event) {
+    }
+
+    public void messageNotDelivered(TransportEvent event) {
+    }
+
+    public void messagePartiallyDelivered(TransportEvent event) {
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,125 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import javax.mail.Address;
+import javax.mail.Message;
+import javax.mail.Transport;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TransportEvent extends MailEvent {
+    /**
+     * Indicates that the message has successfully been delivered to all
+     * recipients.
+     */
+    public static final int MESSAGE_DELIVERED = 1;
+
+    /**
+     * Indicates that no messages could be delivered.
+     */
+    public static final int MESSAGE_NOT_DELIVERED = 2;
+
+    /**
+     * Indicates that some of the messages were successfully delivered
+     * but that some failed.
+     */
+    public static final int MESSAGE_PARTIALLY_DELIVERED = 3;
+
+    /**
+     * The event type.
+     */
+    protected int type;
+
+    /**
+     * Addresses to which the message was successfully delivered.
+     */
+    protected transient Address[] validSent;
+
+    /**
+     * Addresses which are valid but to which the message was not sent.
+     */
+    protected transient Address[] validUnsent;
+
+    /**
+     * Addresses that are invalid.
+     */
+    protected transient Address[] invalid;
+
+    /**
+     * The message associated with this event.
+     */
+    protected transient Message msg;
+
+    /**
+     * Construct a new event,
+     *
+     * @param transport   the transport attempting to deliver the message
+     * @param type        the event type
+     * @param validSent   addresses to which the message was successfully delivered
+     * @param validUnsent addresses which are valid but to which the message was not sent
+     * @param invalid     invalid addresses
+     * @param message     the associated message
+     */
+    public TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message message) {
+        super(transport);
+        this.type = type;
+        this.validSent = validSent;
+        this.validUnsent = validUnsent;
+        this.invalid = invalid;
+        this.msg = message;
+    }
+
+    public Address[] getValidSentAddresses() {
+        return validSent;
+    }
+
+    public Address[] getValidUnsentAddresses() {
+        return validUnsent;
+    }
+
+    public Address[] getInvalidAddresses() {
+        return invalid;
+    }
+
+    public Message getMessage() {
+        return msg;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void dispatch(Object listener) {
+        TransportListener l = (TransportListener) listener;
+        switch (type) {
+        case MESSAGE_DELIVERED:
+            l.messageDelivered(this);
+            break;
+        case MESSAGE_NOT_DELIVERED:
+            l.messageNotDelivered(this);
+            break;
+        case MESSAGE_PARTIALLY_DELIVERED:
+            l.messagePartiallyDelivered(this);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid type " + type);
+        }
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,31 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TransportListener extends EventListener {
+    public abstract void messageDelivered(TransportEvent event);
+
+    public abstract void messageNotDelivered(TransportEvent event);
+
+    public abstract void messagePartiallyDelivered(TransportEvent event);
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/event/TransportListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java?rev=421852&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java (added)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java Fri Jul 14 03:02:19 2006
@@ -0,0 +1,56 @@
+/**
+ *
+ * Copyright 2003-2006 The Apache Software Foundation
+ *
+ *  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 javax.mail.internet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AddressException extends ParseException {
+    protected int pos;
+    protected String ref;
+
+    public AddressException() {
+        this(null);
+    }
+
+    public AddressException(String message) {
+        this(message, null);
+    }
+
+    public AddressException(String message, String ref) {
+        this(message, null, -1);
+    }
+
+    public AddressException(String message, String ref, int pos) {
+        super(message);
+        this.ref = ref;
+        this.pos = pos;
+    }
+
+    public String getRef() {
+        return ref;
+    }
+
+    public int getPos() {
+        return pos;
+    }
+
+    public String toString() {
+        return super.toString() + " (" + ref + "," + pos + ")";
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/main/java/javax/mail/internet/AddressException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain