Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: An Exception thrown when an error occurs because a
4
 *             document with a given ID could not be found in the 
5
 *             metacat database.
6
 *  Copyright: 2000 Regents of the University of California and the
7
 *             National Center for Ecological Analysis and Synthesis
8
 *    Authors: Matt Jones
9
 *
10
 *   '$Author: jones $'
11
 *     '$Date: 2006-11-10 10:25:38 -0800 (Fri, 10 Nov 2006) $'
12
 * '$Revision: 3077 $'
13
 *
14
 * This program is free software; you can redistribute it and/or modify
15
 * it under the terms of the GNU General Public License as published by
16
 * the Free Software Foundation; either version 2 of the License, or
17
 * (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU General Public License
25
 * along with this program; if not, write to the Free Software
26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
 */
28

    
29
package edu.ucsb.nceas.metacat;
30

    
31
/**
32
 * Exception thrown when an error occurs because a document with a
33
 * given ID could not be found in the metacat database.  
34
 */
35
public class McdbDocNotFoundException extends McdbException {
36

    
37
  // String sto stroe which docid couldn't find
38
  private String unfoundDocId = null;
39
  private String unfoundRevision = null;
40
  /**
41
   * Create a new McdbDocNotFoundException.
42
   */
43
  public McdbDocNotFoundException() {
44
    super();
45
    unfoundDocId = null;
46
    unfoundRevision = null;
47
  }
48

    
49
  /**
50
   * Create a new McdbDocNotFoundException.
51
   *
52
   * @param message The error or warning message.
53
   */
54
  public McdbDocNotFoundException(String message, String givenDocId, 
55
                                                    String givenRevision) {
56
    super(message);
57
    unfoundDocId = givenDocId;
58
    unfoundRevision = givenRevision;
59
  }
60

    
61
  /**
62
   * Create a new McdbDocNotFoundException.
63
   *
64
   * @param e The exception to tunnel inside this exception
65
   */
66
  public McdbDocNotFoundException(Exception e) {
67
    super(e);
68
  }
69

    
70
  /**
71
   * Create a new McdbDocNotFoundException.
72
   *
73
   * @param message The error or warning message.
74
   * @param e The exception to tunnel inside this exception
75
   */
76
  public McdbDocNotFoundException(String message, Exception e) {
77
    super(message, e);
78
  }
79
  
80
  /**
81
   * Method to get the docid which couldn't be found
82
   */
83
  public String getUnfoundDocId ()
84
  {
85
    return unfoundDocId;
86
  }// getUnfoundDocid
87
  
88
  /**
89
   * Method to get the docid's revsion which couldn't be found
90
   */
91
  public String getUnfoundRevision ()
92
  {
93
    return unfoundRevision;
94
  }// getUnfoundDocid
95
}
(42-42/65)