dist1.acb.CBL
Class Replica

java.lang.Object
  extended bydist1.acb.CBL.Replica
All Implemented Interfaces:
java.io.Serializable

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

Replica

Version:
$Revision: 1.7 $
Author:
Alexander Stasiv
See Also:
Serialized Form

Constructor Summary
Replica(java.lang.String login, RequestUpdate request)
          Creates a new instance of Replica
 
Method Summary
static void applyReplicas(Replica[] replicas, UpdatesExecutor executor)
          Applies replicas for current server using provided executor
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 Id getId()
          Getter for property id.
 java.lang.String getLogin()
          Getter for property login.
static java.util.LinkedList getMissingReplicas(java.util.List replicas, Id lastReplicaId)
          Returns missing list from replicas
static Id getNextId()
          Getter for property nextId.
 RequestUpdate getRequest()
          Getter for property request.
static boolean isBContinueOfA(java.util.LinkedList a, java.util.LinkedList b)
          Checks if list of replicas B is continue of list A
static void resetId()
          Reset counter of IDs to start point
 void setLogin(java.lang.String login)
          Setter for property login.
 void setRequest(RequestUpdate request)
          Setter for property request.
 java.lang.String toString()
          Returns string description of the object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Replica

public Replica(java.lang.String login,
               RequestUpdate request)
Creates a new instance of Replica

Parameters:
login - Login of the user which initiate the update
request - Request for update
Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Parameters:
obj - the reference object with which to compare
Returns:
true if this object is the same as the obj argument (they have same Id); false otherwise

isBContinueOfA

public static boolean isBContinueOfA(java.util.LinkedList a,
                                     java.util.LinkedList b)
Checks if list of replicas B is continue of list A

Parameters:
a - List A
b - List B
Returns:
true, if next ID of last element in A equals ID of first element in B

getMissingReplicas

public static java.util.LinkedList getMissingReplicas(java.util.List replicas,
                                                      Id lastReplicaId)
Returns missing list from replicas

Parameters:
replicas - "Full list"
lastReplicaId - last present replica
Returns:
New LinkedList
Throws:
java.util.NoSuchElementException - if the replicas which is needed was not found

resetId

public static void resetId()
Reset counter of IDs to start point


setLogin

public void setLogin(java.lang.String login)
Setter for property login.

Parameters:
login - New value of property login.

getLogin

public java.lang.String getLogin()
Getter for property login.

Returns:
Value of property login.

getNextId

public static Id getNextId()
Getter for property nextId.

Returns:
Value of property nextId.

getId

public Id getId()
Getter for property id.

Returns:
Value of property id.

setRequest

public void setRequest(RequestUpdate request)
Setter for property request.

Parameters:
request - New value of property request.

getRequest

public RequestUpdate getRequest()
Getter for property request.

Returns:
Value of property request.

applyReplicas

public static void applyReplicas(Replica[] replicas,
                                 UpdatesExecutor executor)
                          throws java.lang.Exception
Applies replicas for current server using provided executor

Parameters:
replicas - An arrany of replicas to execute
executor - Real executor of replicas
Throws:
java.lang.Exception - if an error has occured during applying the replicas

toString

public java.lang.String toString()
Returns string description of the object

Returns:
String description of the object


Copyright © 2004 Phoenix Team (CMU/AIT). All Rights Reserved.