KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > recoverylog > BackendRecoveryInfo


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
6  * Contact: sequoia@continuent.org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * Initial developer(s): Nicolas Modrzyk.
21  * Contributor(s): Emmanuel Cecchet.
22  */

23
24 package org.continuent.sequoia.controller.recoverylog;
25
26 import org.continuent.sequoia.common.jmx.management.BackendState;
27
28 /**
29  * A instance of this class gives information on a specific backend state from
30  * the recovery log. For a backend, we have its name, the virtual database that
31  * owns it, the lastKnownCheckpoint,and the state of the backend ().
32  *
33  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
34  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
35  * @version 1.0
36  */

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

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

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

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

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

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

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

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

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

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

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