1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * ident "%Z%%M% %I% %E% SMI"
24 *
25 * Copyright (c) 2001 by Sun Microsystems, Inc.
26 * All rights reserved.
27 */
28
29 package com.sun.dhcpmgr.data;
30
31 import java.io.Serializable;
32
33 /**
34 * This class represents an error which occurred during some action
35 */
36 public class ActionError implements Serializable {
37
38 /**
39 * The name of the element that was acted upon
40 */
41 private String name;
42
43 /**
44 * The exception that occurred while acting on the named element
45 */
46 private Exception e;
47
48 /**
49 * Basic constructor.
50 * @param name the element name.
51 */
52 public ActionError(String name) {
53 this.name = name;
54 e = null;
55 } // constructor
56
57 /**
58 * Create a fully formed versoin of this object
59 * @param name The name of the element
60 * @param exception The exception which occurred
61 */
62 public ActionError(String name, Exception exception) {
63 this.name = name;
64 e = exception;
65 }
66
67 /**
68 * Returns the element name.
69 * @return the element name.
70 */
71 public String getName() {
72 return name;
73 } // getName
74
75 /**
76 * Sets the exception.
77 * @param exception the exception to associate with the element.
78 */
79 public void setException(Exception e) {
80 this.e = e;
81 } // setException
82
83 /**
84 * Returns the exception.
85 * @return the exception.
86 */
87 public Exception getException() {
88 return e;
89 } // getException
90 } // ActionError