org.jboss.cache.buddyreplication
Class BuddyFqnTransformer

java.lang.Object
  extended by org.jboss.cache.buddyreplication.BuddyFqnTransformer

public class BuddyFqnTransformer
extends Object

Knows how to transform between fqn and buddy-formated fqns.

Since:
2.2
Author:
Mircea.Markus@jboss.com

Field Summary
static String BUDDY_BACKUP_SUBTREE
           
static Fqn BUDDY_BACKUP_SUBTREE_FQN
           
 
Constructor Summary
BuddyFqnTransformer()
           
 
Method Summary
 Fqn getActualFqn(Fqn fqn)
           
 Fqn getBackupFqn(org.jgroups.Address dataOwnerAddress, Fqn origFqn)
          Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the data owner's Address.
 Fqn getBackupFqn(Fqn buddyGroupRoot, Fqn origFqn)
          Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the backup subtree for the buddy group in question
 Fqn getBackupFqn(String buddyGroupName, Fqn origFqn)
          Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the buddy group name.
 Fqn getBackupRoot(org.jgroups.Address dataOwner)
           
 Fqn getBackupRootFromFqn(Fqn fqn)
          Returns the buddy backp root portion of a given Fqn, provided it is a backup Fqn.
 Fqn getDeadBackupRoot(org.jgroups.Address dataOwner)
          Returns the backup root of a dead data owner
 String getGroupNameFromAddress(org.jgroups.Address address)
           
static boolean isBackupFqn(Fqn name)
           
 boolean isDeadBackupFqn(Fqn name)
          Tests whether a given Fqn belongs to a dead backup region.
 boolean isDeadBackupRoot(Fqn f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUDDY_BACKUP_SUBTREE

public static final String BUDDY_BACKUP_SUBTREE
See Also:
Constant Field Values

BUDDY_BACKUP_SUBTREE_FQN

public static final Fqn BUDDY_BACKUP_SUBTREE_FQN
Constructor Detail

BuddyFqnTransformer

public BuddyFqnTransformer()
Method Detail

getBackupFqn

public Fqn getBackupFqn(org.jgroups.Address dataOwnerAddress,
                        Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the data owner's Address.

Parameters:
dataOwnerAddress - the JGroups Address of the data owner
origFqn - the original Fqn
Returns:
a backup Fqn

getBackupFqn

public Fqn getBackupFqn(String buddyGroupName,
                        Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the buddy group name.

Parameters:
buddyGroupName - the buddy group name
origFqn - the original Fqn
Returns:
a backup Fqn

getBackupFqn

public Fqn getBackupFqn(Fqn buddyGroupRoot,
                        Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the backup subtree for the buddy group in question

Parameters:
buddyGroupRoot - the subtree under which data for a particular buddy is backed up
origFqn - the original Fqn
Returns:
a backup Fqn

isBackupFqn

public static boolean isBackupFqn(Fqn name)

getActualFqn

public Fqn getActualFqn(Fqn fqn)

isDeadBackupFqn

public boolean isDeadBackupFqn(Fqn name)
Tests whether a given Fqn belongs to a dead backup region.

Parameters:
name - fqn to test
Returns:
true if the fqn is a part of a dead backup region; false otherwise.

getBackupRoot

public Fqn getBackupRoot(org.jgroups.Address dataOwner)
Parameters:
dataOwner - owner of a data set
Returns:
a backup root for a given data owner

getDeadBackupRoot

public Fqn getDeadBackupRoot(org.jgroups.Address dataOwner)
Returns the backup root of a dead data owner

Parameters:
dataOwner - owner of data
Returns:
Fqn of dead data owner's root

isDeadBackupRoot

public boolean isDeadBackupRoot(Fqn f)

getGroupNameFromAddress

public String getGroupNameFromAddress(org.jgroups.Address address)

getBackupRootFromFqn

public Fqn getBackupRootFromFqn(Fqn fqn)
Returns the buddy backp root portion of a given Fqn, provided it is a backup Fqn. If it is not a backup Fqn, Fqn.ROOT is returned.

Parameters:
fqn - fqn
Returns:
a backup root from an Fqn


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.