org.objectweb.cjdbc.controller.backend
Class BackendRecoveryPolicy

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.backend.BackendRecoveryPolicy
All Implemented Interfaces:
java.io.Serializable

public class BackendRecoveryPolicy
extends java.lang.Object
implements java.io.Serializable

Distributed backend policy for distributed virtual databases (horizontal scalability).

Version:
1.0
Author:
Emmanuel Cecchet
See Also:
Serialized Form

Field Summary
private  java.lang.String backendName
           
private  java.util.ArrayList controllers
           
private  boolean recoveryPolicy
           
 
Constructor Summary
BackendRecoveryPolicy(java.lang.String backendName, boolean recoveryPolicy)
          Create a new BackendRecoveryPolicy
 
Method Summary
 void addController(java.lang.String controllerName)
          Add a controller name that can recover this backend in case of the failure of the current controller.
 java.lang.String getBackendName()
          Get the backend name
 boolean getRecoveryPolicy()
          Get the recoveryPolicy
 java.lang.String getXml()
          Get the XML dump of this BackendRecoveryPolicy element
 boolean isEligibleForRecovery(java.lang.String controllerName)
          Returns whether the given controller name is authorized to recover this backend or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backendName

private java.lang.String backendName

recoveryPolicy

private boolean recoveryPolicy

controllers

private java.util.ArrayList controllers
Constructor Detail

BackendRecoveryPolicy

public BackendRecoveryPolicy(java.lang.String backendName,
                             boolean recoveryPolicy)
Create a new BackendRecoveryPolicy

Parameters:
backendName - backend name
recoveryPolicy - true if backends must be recovered
Method Detail

getBackendName

public java.lang.String getBackendName()
Get the backend name

Returns:
backend name

getRecoveryPolicy

public boolean getRecoveryPolicy()
Get the recoveryPolicy

Returns:
true if the recovery policy is on, false otherwise.

addController

public void addController(java.lang.String controllerName)
                   throws ControllerException
Add a controller name that can recover this backend in case of the failure of the current controller.

Parameters:
controllerName - name of the controller
Throws:
ControllerException - if the recovery policy is off

isEligibleForRecovery

public boolean isEligibleForRecovery(java.lang.String controllerName)
Returns whether the given controller name is authorized to recover this backend or not.

Parameters:
controllerName - controller asking for recovery
Returns:
true if the controller is eligible

getXml

public java.lang.String getXml()
Get the XML dump of this BackendRecoveryPolicy element

Returns:
XML dump of this BackendRecoveryPolicy element


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.