01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2006 Continuent, Inc.
04: * Contact: sequoia@continuent.org
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: */package org.continuent.sequoia.controller.virtualdatabase;
19:
20: /**
21: * Type-safe enum representing outcomes of a reconciliation between two virtual databases
22: * parts after a network partition has been detected
23: */
24: final class PartitionReconciliationStatus {
25:
26: static final PartitionReconciliationStatus NO_ACTIVITY = new PartitionReconciliationStatus(
27: "No activity detected on both virtual database parts during network failure");
28: static final PartitionReconciliationStatus ALONE_IN_THE_WORLD = new PartitionReconciliationStatus(
29: "This virtual database part was isolated during network failure");
30: static final PartitionReconciliationStatus OTHER_ALONE_IN_THE_WORLD = new PartitionReconciliationStatus(
31: "The other virtual database part was isolated during network failure");
32: static final PartitionReconciliationStatus SPLIT_BRAIN = new PartitionReconciliationStatus(
33: "Activities on both virtual database parts during network failure: Split brain detected!!!");
34:
35: private String description;
36:
37: private PartitionReconciliationStatus(String description) {
38: this .description = description;
39: }
40:
41: /**
42: * {@inheritDoc}
43: */
44: public String toString() {
45: return description;
46: }
47: }
|