Skip to content

Package: SendFailedException

SendFailedException

nameinstructionbranchcomplexitylinemethod
SendFailedException()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
SendFailedException(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
SendFailedException(String, Exception)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
SendFailedException(String, Exception, Address[], Address[], Address[])
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getInvalidAddresses()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getValidSentAddresses()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getValidUnsentAddresses()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail;
18:
19: /**
20: * This exception is thrown when the message cannot be sent.<p>
21: *
22: * The exception includes those addresses to which the message could not be
23: * sent as well as the valid addresses to which the message was sent and
24: * valid addresses to which the message was not sent.
25: *
26: * @author John Mani
27: * @author Max Spivak
28: * @see jakarta.mail.Transport#send
29: * @see jakarta.mail.Transport#sendMessage
30: * @see jakarta.mail.event.TransportEvent
31: */
32:
33: public class SendFailedException extends MessagingException {
34: transient protected Address[] invalid;
35: transient protected Address[] validSent;
36: transient protected Address[] validUnsent;
37:
38: private static final long serialVersionUID = -6457531621682372913L;
39:
40: /**
41: * Constructs a SendFailedException with no detail message.
42: */
43: public SendFailedException() {
44: super();
45: }
46:
47: /**
48: * Constructs a SendFailedException with the specified detail message.
49: *
50: * @param s the detail message
51: */
52: public SendFailedException(String s) {
53: super(s);
54: }
55:
56: /**
57: * Constructs a SendFailedException with the specified
58: * Exception and detail message. The specified exception is chained
59: * to this exception.
60: *
61: * @param s the detail message
62: * @param e the embedded exception
63: * @see #getNextException
64: * @see #setNextException
65: */
66: public SendFailedException(String s, Exception e) {
67: super(s, e);
68: }
69:
70:
71: /**
72: * Constructs a SendFailedException with the specified string
73: * and the specified address objects.
74: *
75: * @param msg the detail message
76: * @param ex the embedded exception
77: * @param validSent valid addresses to which message was sent
78: * @param validUnsent valid addresses to which message was not sent
79: * @param invalid the invalid addresses
80: * @see #getNextException
81: * @see #setNextException
82: */
83: public SendFailedException(String msg, Exception ex, Address[] validSent,
84: Address[] validUnsent, Address[] invalid) {
85: super(msg, ex);
86: this.validSent = validSent;
87: this.validUnsent = validUnsent;
88: this.invalid = invalid;
89: }
90:
91: /**
92: * Return the addresses to which this message was sent succesfully.
93: *
94: * @return Addresses to which the message was sent successfully or null
95: */
96: public Address[] getValidSentAddresses() {
97: return validSent;
98: }
99:
100: /**
101: * Return the addresses that are valid but to which this message
102: * was not sent.
103: *
104: * @return Addresses that are valid but to which the message was
105: * not sent successfully or null
106: */
107: public Address[] getValidUnsentAddresses() {
108: return validUnsent;
109: }
110:
111: /**
112: * Return the addresses to which this message could not be sent.
113: *
114: * @return Addresses to which the message sending failed or null;
115: */
116: public Address[] getInvalidAddresses() {
117: return invalid;
118: }
119: }