001: /**
002: * Sequoia: Database clustering technology.
003: * Copyright (C) 2002-2004 French National Institute For Research In Computer
004: * Science And Control (INRIA).
005: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006: * Contact: sequoia@continuent.org
007: *
008: * Licensed under the Apache License, Version 2.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: * Initial developer(s): Nicolas Modrzyk.
021: * Contributor(s): Emmanuel Cecchet.
022: */package org.continuent.sequoia.controller.recoverylog;
023:
024: import org.continuent.sequoia.common.jmx.management.BackendState;
025:
026: /**
027: * A instance of this class gives information on a specific backend state from
028: * the recovery log. For a backend, we have its name, the virtual database that
029: * owns it, the lastKnownCheckpoint,and the state of the backend ().
030: *
031: * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
032: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
033: * @version 1.0
034: */
035: public final class BackendRecoveryInfo {
036: private String backendName;
037: private String checkpoint;
038: /** State is defined in <code>BackendState</code> */
039: private int backendState;
040: private String virtualDatabase;
041:
042: /**
043: * Creates a new <code>BackendRecoveryInfo</code> object
044: *
045: * @param backendName backend name
046: * @param lastCheckpoint last known checkpoint name
047: * @param backendState backend state as defined in <code>BackendState</code>
048: * @param virtualDatabase virtual database name
049: */
050: public BackendRecoveryInfo(String backendName,
051: String lastCheckpoint, int backendState,
052: String virtualDatabase) {
053: this .backendName = backendName;
054: this .checkpoint = lastCheckpoint;
055: this .backendState = backendState;
056: this .virtualDatabase = virtualDatabase;
057: }
058:
059: /**
060: * Returns the backendName value.
061: *
062: * @return Returns the backendName.
063: */
064: public String getBackendName() {
065: return backendName;
066: }
067:
068: /**
069: * Sets the backendName value.
070: *
071: * @param backendName The backendName to set.
072: */
073: public void setBackendName(String backendName) {
074: this .backendName = backendName;
075: }
076:
077: /**
078: * Returns the backend state as defined in <code>BackendState</code>.
079: *
080: * @return Returns the backend state.
081: */
082: public int getBackendState() {
083: return backendState;
084: }
085:
086: /**
087: * Sets the backend state value. The value must be defined in
088: * <code>BackendState</code>
089: *
090: * @param backendState The backend state to set.
091: */
092: public void setBackendState(int backendState) {
093: this .backendState = backendState;
094: }
095:
096: /**
097: * Returns the lastCheckpoint value.
098: *
099: * @return Returns the lastCheckpoint.
100: */
101: public String getCheckpoint() {
102: return checkpoint;
103: }
104:
105: /**
106: * Sets the lastCheckpoint value.
107: *
108: * @param lastCheckpoint The lastCheckpoint to set.
109: */
110: public void setCheckpoint(String lastCheckpoint) {
111: this .checkpoint = lastCheckpoint;
112: }
113:
114: /**
115: * Returns the virtualDatabase value.
116: *
117: * @return Returns the virtualDatabase.
118: */
119: public String getVirtualDatabase() {
120: return virtualDatabase;
121: }
122:
123: /**
124: * Sets the virtualDatabase value.
125: *
126: * @param virtualDatabase The virtualDatabase to set.
127: */
128: public void setVirtualDatabase(String virtualDatabase) {
129: this .virtualDatabase = virtualDatabase;
130: }
131:
132: /**
133: * @see java.lang.Object#toString()
134: */
135: public String toString() {
136: return "Backend:" + this .backendName + ", VirtualDatabase:"
137: + this .virtualDatabase + ", State:"
138: + BackendState.description(this .backendState)
139: + ", Checkpoint:" + this.checkpoint;
140: }
141: }
|