KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > common > exceptions > NoMoreBackendException


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2005 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): Emmanuel Cecchet.
23  */

24
25 package org.objectweb.cjdbc.common.exceptions;
26
27 import java.sql.SQLException JavaDoc;
28
29 /**
30  * This class defines a NoMoreBackendException. This means that a controller
31  * does not have any backend left to execute the query. The exception might
32  * carry an optional identifier of the request that failed. This is useful to
33  * unlog a remote request that has failed since each controller has its own
34  * local id for each distributed request.
35  *
36  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
37  * @author <a HREF="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
38  * </a>
39  * @version 1.0
40  */

41 public class NoMoreBackendException extends SQLException JavaDoc
42 {
43   private static final long serialVersionUID = 8265839783849395122L;
44
45   private long recoveryLogId = 0;
46   private String JavaDoc login = null;
47
48   /**
49    * Creates a new <code>NoMoreBackendException</code> object
50    */

51   public NoMoreBackendException()
52   {
53     super();
54   }
55
56   /**
57    * Creates a new <code>NoMoreBackendException</code> object
58    *
59    * @param reason the error message
60    */

61   public NoMoreBackendException(String JavaDoc reason)
62   {
63     super(reason);
64   }
65
66   /**
67    * Creates a new <code>NoMoreBackendException</code> object
68    *
69    * @param reason the error message
70    * @param sqlState the SQL state
71    */

72   public NoMoreBackendException(String JavaDoc reason, String JavaDoc sqlState)
73   {
74     super(reason, sqlState);
75   }
76
77   /**
78    * Creates a new <code>NoMoreBackendException</code> object
79    *
80    * @param reason the error message
81    * @param sqlState the SQL state
82    * @param vendorCode vendor specific code
83    */

84   public NoMoreBackendException(String JavaDoc reason, String JavaDoc sqlState, int vendorCode)
85   {
86     super(reason, sqlState, vendorCode);
87   }
88
89   /**
90    * Returns the recovery log id of the request that failed.
91    *
92    * @return Returns the recoveryLogId.
93    */

94   public long getRecoveryLogId()
95   {
96     return recoveryLogId;
97   }
98
99   /**
100    * Sets the recovery log id of the request that failed.
101    *
102    * @param recoveryLogId The recoveryLogId to set.
103    */

104   public void setRecoveryLogId(long recoveryLogId)
105   {
106     this.recoveryLogId = recoveryLogId;
107   }
108
109   /**
110    * Returns the login of the request that failed.
111    *
112    * @return Returns the login.
113    */

114   public String JavaDoc getLogin()
115   {
116     return login;
117   }
118
119   /**
120    * Sets the login of the request that failed.
121    *
122    * @param login The login to set.
123    */

124   public void setLogin(String JavaDoc login)
125   {
126     this.login = login;
127   }
128 }
Popular Tags