FileDocCategorySizeDatePackage
SubPartitionsInfo.javaAPI DocJBoss 4.2.14071Fri Jul 13 20:52:38 BST 2007org.jboss.ha.framework.interfaces

SubPartitionsInfo

public class SubPartitionsInfo extends Object implements Serializable, Cloneable
Holder class that knows about a set of HA(sub)Partition currently building the overall cluster. Exchanged between HASessionState instances to share the same knowledge.
see
SubPartitionInfo
see
org.jboss.ha.hasessionstate.interfaces.HASessionState
see
org.jboss.ha.hasessionstate.server.HASessionStateImpl
author
Sacha Labourey
version
$Revision: 57188 $

Fields Summary
private static final long
serialVersionUID
The serialVersionUID
public SubPartitionInfo[]
partitions
protected long
groupId
Constructors Summary
public SubPartitionsInfo()


    // Static --------------------------------------------------------
   
   // Constructors --------------------------------------------------
   
       
Methods Summary
public java.lang.Objectclone()

       SubPartitionsInfo theClone = new SubPartitionsInfo ();
       
       if (partitions != null)
       {
          theClone.partitions = new SubPartitionInfo[partitions.length];
         for (int i=0; i<partitions.length; i++)
            theClone.partitions[i] = (SubPartitionInfo)partitions[i].clone ();
       }
       
       theClone.groupId = groupId;            
       
       return theClone;
       
    
public longgetNextGroupId()
return the next distinct id for a new group

       return groupId++;
    
public SubPartitionInfogetSubPartitionWithName(java.lang.String name)
Returns the {@link SubPartitionInfo} instance in this group that has the given name.

       if (partitions != null)
       {
         for (int i=0; i<partitions.length; i++)
            if ((partitions[i]).containsNode (name))
               return partitions[i];
       }

       return null;
    
public java.lang.StringtoString()

       String result = null;
       
       if (partitions == null)
          result = "{null}";
       else
       {
          result = "{";
          for (int i=0; i<partitions.length; i++)
             result+= "\n " + partitions[i].toString ();
          result+= "\n}";
       }
       
       return result;