KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > controller > recoverylog > BackendRecoveryInfo


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.controller.recoverylog;
26
27 /**
28  * A instance of this class gives information on a specific backend state from
29  * the recovery log. For a backend, we have its name, the virtual database that
30  * owns it, the lastKnownCheckpoint,and the state of the backend ().
31  *
32  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
33  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
34  * @version 1.0
35  */

36 public final class BackendRecoveryInfo
37 {
38   private String JavaDoc backendName;
39   private String JavaDoc checkpoint;
40   /** State is defined in <code>BackendState</code> */
41   private int backendState;
42   private String JavaDoc virtualDatabase;
43
44   /**
45    * Creates a new <code>BackendRecoveryInfo</code> object
46    *
47    * @param backendName backend name
48    * @param lastCheckpoint last known checkpoint name
49    * @param backendState backend state as defined in <code>BackendState</code>
50    * @param virtualDatabase virtual database name
51    */

52   public BackendRecoveryInfo(String JavaDoc backendName, String JavaDoc lastCheckpoint,
53       int backendState, String JavaDoc virtualDatabase)
54   {
55     this.backendName = backendName;
56     this.checkpoint = lastCheckpoint;
57     this.backendState = backendState;
58     this.virtualDatabase = virtualDatabase;
59   }
60
61   /**
62    * Returns the backendName value.
63    *
64    * @return Returns the backendName.
65    */

66   public String JavaDoc getBackendName()
67   {
68     return backendName;
69   }
70
71   /**
72    * Sets the backendName value.
73    *
74    * @param backendName The backendName to set.
75    */

76   public void setBackendName(String JavaDoc backendName)
77   {
78     this.backendName = backendName;
79   }
80
81   /**
82    * Returns the backend state as defined in <code>BackendState</code>.
83    *
84    * @return Returns the backend state.
85    */

86   public int getBackendState()
87   {
88     return backendState;
89   }
90
91   /**
92    * Sets the backend state value. The value must be defined in
93    * <code>BackendState</code>
94    *
95    * @param backendState The backend state to set.
96    */

97   public void setBackendState(int backendState)
98   {
99     this.backendState = backendState;
100   }
101
102   /**
103    * Returns the lastCheckpoint value.
104    *
105    * @return Returns the lastCheckpoint.
106    */

107   public String JavaDoc getCheckpoint()
108   {
109     return checkpoint;
110   }
111
112   /**
113    * Sets the lastCheckpoint value.
114    *
115    * @param lastCheckpoint The lastCheckpoint to set.
116    */

117   public void setCheckpoint(String JavaDoc lastCheckpoint)
118   {
119     this.checkpoint = lastCheckpoint;
120   }
121
122   /**
123    * Returns the virtualDatabase value.
124    *
125    * @return Returns the virtualDatabase.
126    */

127   public String JavaDoc getVirtualDatabase()
128   {
129     return virtualDatabase;
130   }
131
132   /**
133    * Sets the virtualDatabase value.
134    *
135    * @param virtualDatabase The virtualDatabase to set.
136    */

137   public void setVirtualDatabase(String JavaDoc virtualDatabase)
138   {
139     this.virtualDatabase = virtualDatabase;
140   }
141
142   /**
143    * @see java.lang.Object#toString()
144    */

145   public String JavaDoc toString()
146   {
147     return "Backend:" + this.backendName + ",VirtualDatabase:"
148         + this.virtualDatabase + ",State:" + this.backendState + ",Checkpoint:"
149         + this.checkpoint;
150   }
151 }
Popular Tags