ariba.util.core
Class ChecksumManager

java.lang.Object
  extended by ariba.util.core.ChecksumManager

public class ChecksumManager
extends java.lang.Object

Service that manages ComponentChecksums. Used during the startup process to verify that all nodes within a group are configured the same way. Each component needs to decide what constitutes that component's configuration, and what sort of checksum will be adequate to catch inconsistencies. This information is embodied in the ComponentChecksum abstract class. The ComponentChecksum consists of a component name, which must be unique, and an arbitrary length byte array. There are two concrete classes provided that extend ComponentChecksum: FileComponentChecksum, for handling components who's entire state is stored in files, and SimpleComponentChecksum that will accept a byte array as the checksum. Components will register specific ComponentChecksums with the manager. The BaseServer will get all the checksums and compare them with checksums on remote machines to decide whether or not a node is configured the same as the cluster. See http://development.ariba.com/PSS/CoreServer/multiserver/Component Checksum.doc and http://development.ariba.com/PSS/CoreServer/multiserver/Group Restart.doc for details on how all this works.


Constructor Summary
ChecksumManager()
           
 
Method Summary
 boolean compareChecksums()
          check to see if the component checksums from another node match the current component checksums.
 java.util.List getAll()
          return the List of all component checksums.
static ChecksumManager getChecksumManager()
          Get the ChecksumManager service.
 java.util.List getRemoteChecksums()
          get the remote checksum in the Checksum manager Return the List of ComponentChecksums from other nodes
static State getState()
          Get the State in which to store the instance.
 void register(ComponentChecksum cc)
          register the component checksum with the manager.
 void reRegister(ComponentChecksum cc)
          re-register the component checksum with the manager.
static void setChecksumManager(ChecksumManager serv)
          Set the instance of the checksum manager.
 void setRemoteChecksums(java.util.List checksums)
          set the remote checksum in the Checksum manager, should be only be called by one thread
static void setState(State s)
          Set the state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChecksumManager

public ChecksumManager()
Method Detail

getChecksumManager

public static ChecksumManager getChecksumManager()
Get the ChecksumManager service. Create the instance if one does not exist. This follows the standard Ariba service pattern.

Returns:
the ChecksumManager

setChecksumManager

public static void setChecksumManager(ChecksumManager serv)
Set the instance of the checksum manager. Only called by getChecksumManger

Parameters:
serv - The instance

getState

public static State getState()
Get the State in which to store the instance. Create a new GlobalState if it does not exist. This service is only saved as a Global State

Returns:
State variable

setState

public static void setState(State s)
Set the state. Only called from getState.

Parameters:
s - The state variable

register

public void register(ComponentChecksum cc)
              throws ComponentChecksumException
register the component checksum with the manager. Throws ComponentChecksumException if the component is already registered.

Parameters:
cc - the component checksum from some package
Throws:
ComponentChecksumException

reRegister

public void reRegister(ComponentChecksum cc)
                throws ComponentChecksumException
re-register the component checksum with the manager. Replace the old value if the component already exists

Parameters:
cc - the component checksum from some package
Throws:
ComponentChecksumException

getAll

public java.util.List getAll()
return the List of all component checksums. This vector will be sorted on increasing key value

Returns:
List of all registered ComponentChecsums

compareChecksums

public boolean compareChecksums()
check to see if the component checksums from another node match the current component checksums. Return true if everything matchs, false otherwise


setRemoteChecksums

public void setRemoteChecksums(java.util.List checksums)
set the remote checksum in the Checksum manager, should be only be called by one thread

Parameters:
checksums - the List of ComponentChecksums from other nodes

getRemoteChecksums

public java.util.List getRemoteChecksums()
get the remote checksum in the Checksum manager Return the List of ComponentChecksums from other nodes



AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.