svn commit: r1900504 [7/22] - in /geronimo/specs/trunk: ./ geronimo-activation_2.0_spec/ geronimo-activation_2.0_spec/src/ geronimo-activation_2.0_spec/src/main/ geronimo-activation_2.0_spec/src/main/java/ geronimo-activation_2.0_spec/src/main/java/jak...

[email protected] Tue, 03 May 2022 12:22:12 -0000
Newsgroups gmane.comp.java.geronimo.cvs
Message-ID <[email protected]>
Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/URLName.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/URLName.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/URLName.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/URLName.java Tue May  3 12:22:08 2022
@@ -0,0 +1,323 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class URLName {
+    private static final String nonEncodedChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.*";
+    
+    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(final String url) {
+        parseString(url);
+    }
+
+    protected void parseString(final String url) {
+        URI uri;
+        try {
+            if (url == null) {
+                uri = null;
+            } else {
+                uri = new URI(url);
+            }
+        } catch (final 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());
+        // if the file starts with "/", we need to strip that off. 
+        // URL and URLName do not have the same behavior when it comes 
+        // to keeping that there. 
+        if (file != null && file.length() > 1 && file.startsWith("/")) {
+            file = checkBlank(file.substring(1)); 
+        }
+        
+        ref = checkBlank(uri.getFragment());
+        final String userInfo = checkBlank(uri.getUserInfo());
+        if (userInfo == null) {
+            username = null;
+            password = null;
+        } else {
+            final 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(final String protocol, final String host, final int port, final 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 {
+            final 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;
+        }
+        username = encode(username); 
+        password = encode(password); 
+        updateFullURL();
+    }
+
+    public URLName(final URL url) {
+        protocol = checkBlank(url.getProtocol());
+        host = checkBlank(url.getHost());
+        port = url.getPort();
+        file = checkBlank(url.getFile());
+        ref = checkBlank(url.getRef());
+        final String userInfo = checkBlank(url.getUserInfo());
+        if (userInfo == null) {
+            username = null;
+            password = null;
+        } else {
+            final 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(final String target) {
+        if (target == null || target.length() == 0) {
+            return null;
+        } else {
+            return target;
+        }
+    }
+
+    private void updateFullURL() {
+        hashCode = 0;
+        final StringBuffer buf = new StringBuffer(100);
+        if (protocol != null) {
+            buf.append(protocol).append(':');
+            if (host != null) {
+                buf.append("//");
+                if (username != null) {
+                    buf.append(encode(username));
+                    if (password != null) {
+                        buf.append(':').append(encode(password));
+                    }
+                    buf.append('@');
+                }
+                buf.append(host);
+                if (port != -1) {
+                    buf.append(':').append(port);
+                }
+                if (file != null) {
+                    buf.append('/').append(file);
+                }
+                hashCode = buf.toString().hashCode();
+                if (ref != null) {
+                    buf.append('#').append(ref);
+                }
+            }
+        }
+        fullURL = buf.toString();
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if(this == o) {
+        	return true;
+        }
+    	
+    	if (o instanceof URLName == false) {
+            return false;
+        }
+        final 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(final String s1, final String s2) {
+        if (s1 == null) {
+            return s2 == null;
+        } else {
+            return s1.equals(s2);
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        return hashCode;
+    }
+
+    @Override
+    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;
+    }
+    
+    /**
+     * Perform an HTTP encoding to the username and 
+     * password elements of the URLName.  
+     * 
+     * @param v      The input (uncoded) string.
+     * 
+     * @return The HTTP encoded version of the string. 
+     */
+    private static String encode(final String v) {
+        // make sure we don't operate on a null string
+        if (v == null) {
+            return null; 
+        }
+        boolean needsEncoding = false; 
+        for (int i = 0; i < v.length(); i++) {
+            // not in the list of things that don't need encoding?
+            if (nonEncodedChars.indexOf(v.charAt(i)) == -1) {
+                // got to do this the hard way
+                needsEncoding = true; 
+                break; 
+            }
+        }
+        // just fine the way it is. 
+        if (!needsEncoding) {
+            return v; 
+        }
+        
+        // we know we're going to be larger, but not sure by how much.  
+        // just give a little extra
+        final StringBuffer encoded = new StringBuffer(v.length() + 10);
+            
+        // we get the bytes so that we can have the default encoding applied to 
+        // this string.  This will flag the ones we need to give special processing to. 
+        final byte[] data = v.getBytes(); 
+        
+        for (int i = 0; i < data.length; i++) {
+            // pick this up as a one-byte character The 7-bit ascii ones will be fine 
+            // here. 
+            final char ch = (char)(data[i] & 0xff); 
+            // blanks get special treatment 
+            if (ch == ' ') {
+                encoded.append('+'); 
+            }
+            // not in the list of things that don't need encoding?
+            else if (nonEncodedChars.indexOf(ch) == -1) {
+                // forDigit() uses the lowercase letters for the radix.  The HTML specifications 
+                // require the uppercase letters. 
+                final char firstChar = Character.toUpperCase(Character.forDigit((ch >> 4) & 0xf, 16)); 
+                final char secondChar = Character.toUpperCase(Character.forDigit(ch & 0xf, 16)); 
+                
+                // now append the encoded triplet. 
+                encoded.append('%'); 
+                encoded.append(firstChar); 
+                encoded.append(secondChar); 
+            }
+            else {
+                // just add this one to the buffer 
+                encoded.append(ch); 
+            }
+        }
+        // convert to string form. 
+        return encoded.toString(); 
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionAdapter.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionAdapter.java Tue May  3 12:22:08 2022
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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(final ConnectionEvent event) {
+    }
+
+    public void disconnected(final ConnectionEvent event) {
+    }
+
+    public void opened(final ConnectionEvent event) {
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ConnectionEvent extends MailEvent {
+	
+	private static final long serialVersionUID = -1855480171284792957L;
+	
+    /**
+     * 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(final Object source, final int type) {
+        super(source);
+        this.type = type;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        // assume that it is the right listener type
+        final 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);
+        }
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/ConnectionListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderAdapter.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderAdapter.java Tue May  3 12:22:08 2022
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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(final FolderEvent event) {
+    }
+
+    public void folderDeleted(final FolderEvent event) {
+    }
+
+    public void folderRenamed(final FolderEvent event) {
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import jakarta.mail.Folder;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class FolderEvent extends MailEvent {
+	
+	private static final long serialVersionUID = 5278131310563694307L;
+	
+    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(final Object source, final Folder oldFolder, final Folder newFolder, final 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(final Object source, final Folder folder, final int type) {
+        this(source, folder, null, type);
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        final 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;
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/FolderListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MailEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MailEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MailEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MailEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import java.util.EventObject;
+
+/**
+ * Common base class for mail events.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class MailEvent extends EventObject {
+	
+	private static final long serialVersionUID = 1846275636325456631L;
+	
+    public MailEvent(final Object source) {
+        super(source);
+    }
+
+    public abstract void dispatch(Object listener);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import jakarta.mail.Message;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MessageChangedEvent extends MailEvent {
+	
+	private static final long serialVersionUID = -4974972972105535108L;
+	
+    /**
+     * 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(final Object source, final int type, final Message message) {
+        super(source);
+        msg = message;
+        this.type = type;
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        final 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;
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageChangedListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface MessageChangedListener extends EventListener {
+    public abstract void messageChanged(MessageChangedEvent event);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountAdapter.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountAdapter.java Tue May  3 12:22:08 2022
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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(final MessageCountEvent event) {
+    }
+
+    public void messagesRemoved(final MessageCountEvent event) {
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import jakarta.mail.Folder;
+import jakarta.mail.Message;
+
+/**
+ * Event indicating a change in the number of messages in a folder.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MessageCountEvent extends MailEvent {
+	
+	private static final long serialVersionUID = -7447022340837897369L;
+	
+    /**
+     * 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(final Folder folder, final int type, final boolean removed, final 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;
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        final 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);
+        }
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/MessageCountListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import jakarta.mail.Store;
+
+/**
+ * Event representing motifications from the Store connection.
+ *
+ * @version $Rev$ $Date$
+ */
+public class StoreEvent extends MailEvent {
+	
+	private static final long serialVersionUID = 1938704919992515330L;
+	
+    /**
+     * 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(final Store store, final int type, final 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;
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        ((StoreListener) listener).notification(this);
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/StoreListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import java.util.EventListener;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface StoreListener extends EventListener {
+    public abstract void notification(StoreEvent event);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportAdapter.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportAdapter.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportAdapter.java Tue May  3 12:22:08 2022
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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(final TransportEvent event) {
+    }
+
+    public void messageNotDelivered(final TransportEvent event) {
+    }
+
+    public void messagePartiallyDelivered(final TransportEvent event) {
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportEvent.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportEvent.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportEvent.java Tue May  3 12:22:08 2022
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.event;
+
+import jakarta.mail.Address;
+import jakarta.mail.Message;
+import jakarta.mail.Transport;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TransportEvent extends MailEvent {
+	
+	private static final long serialVersionUID = -4729852364684273073L;
+	
+    /**
+     * 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(final Transport transport, final int type, final Address[] validSent, final Address[] validUnsent, final Address[] invalid, final 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;
+    }
+
+    @Override
+    public void dispatch(final Object listener) {
+        final 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);
+        }
+    }
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportListener.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportListener.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/event/TransportListener.java Tue May  3 12:22:08 2022
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.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);
+}

Added: geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/internet/AddressException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/internet/AddressException.java?rev=1900504&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/internet/AddressException.java (added)
+++ geronimo/specs/trunk/geronimo-jakartamail_2.1_spec/src/main/java/jakarta/mail/internet/AddressException.java Tue May  3 12:22:08 2022
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 jakarta.mail.internet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AddressException extends ParseException {
+	
+	private static final long serialVersionUID = 9134583443539323120L;
+	
+    protected int pos;
+    protected String ref;
+
+    public AddressException() {
+        this(null);
+    }
+
+    public AddressException(final String message) {
+        this(message, null);
+    }
+
+    public AddressException(final String message, final String ref) {
+        this(message, null, -1);
+    }
+
+    public AddressException(final String message, final String ref, final int pos) {
+        super(message);
+        this.ref = ref;
+        this.pos = pos;
+    }
+
+    public String getRef() {
+        return ref;
+    }
+
+    public int getPos() {
+        return pos;
+    }
+
+    @Override
+    public String toString() {
+        return super.toString() + " (" + ref + "," + pos + ")";
+    }
+}