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: 2010-03-17 18:54:50 -0700 (Wed, 17 Mar 2010) $'
12
 * '$Revision: 5282 $'
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
  /**
42
   * Create a new McdbDocNotFoundException.
43
   */
44
  public McdbDocNotFoundException() {
45
    super();
46
    unfoundDocId = null;
47
    unfoundRevision = null;
48
  }
49

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

    
62
  /**
63
   * Create a new exception but only set the message.
64
   * @param message a message giving information about why the document was not found
65
   */
66
  public McdbDocNotFoundException(String message) {
67
      super(message);
68
  }
69
  
70
  /**
71
   * Create a new McdbDocNotFoundException.
72
   *
73
   * @param e The exception to tunnel inside this exception
74
   */
75
  public McdbDocNotFoundException(Exception e) {
76
    super(e);
77
  }
78

    
79
  /**
80
   * Create a new McdbDocNotFoundException.
81
   *
82
   * @param message The error or warning message.
83
   * @param e The exception to tunnel inside this exception
84
   */
85
  public McdbDocNotFoundException(String message, Exception e) {
86
    super(message, e);
87
  }
88
  
89
  /**
90
   * Method to get the docid which couldn't be found
91
   */
92
  public String getUnfoundDocId ()
93
  {
94
    return unfoundDocId;
95
  }// getUnfoundDocid
96
  
97
  /**
98
   * Method to get the docid's revsion which couldn't be found
99
   */
100
  public String getUnfoundRevision ()
101
  {
102
    return unfoundRevision;
103
  }// getUnfoundDocid
104
}
(40-40/64)