org.objectweb.cjdbc.controller.loadbalancer.policies.createtable
Class CreateTableRandom

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.loadbalancer.policies.createtable.CreateTableRule
      extended byorg.objectweb.cjdbc.controller.loadbalancer.policies.createtable.CreateTableRandom

public class CreateTableRandom
extends CreateTableRule

Implements a random strategy for CREATE TABLE statements.

Version:
1.0
Author:
Emmanuel Cecchet, Jean-Bernard van Zuylen

Field Summary
private  java.util.Random random
           
 
Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.policies.createtable.CreateTableRule
backendList, nbOfNodes, policy, tableName
 
Constructor Summary
CreateTableRandom()
          Creates a new CreateTableRandom.
CreateTableRandom(java.util.ArrayList backendList)
          Creates a new CreateTableRandom.
 
Method Summary
 java.util.ArrayList getBackends(java.util.ArrayList backends)
          Pickups backends from the given backends arraylist according to the current rule policy.
 java.lang.String getInformation()
          Gives information about the current policy.
 
Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.policies.createtable.CreateTableRule
addBackendName, getBackendList, getNumberOfNodes, getPolicy, getTableName, getXml, isDefaultRule, setNumberOfNodes, setPolicy, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

private java.util.Random random
Constructor Detail

CreateTableRandom

public CreateTableRandom()
Creates a new CreateTableRandom.


CreateTableRandom

public CreateTableRandom(java.util.ArrayList backendList)
Creates a new CreateTableRandom.

Parameters:
backendList - ArrayList of DatabaseBackend
Method Detail

getBackends

public java.util.ArrayList getBackends(java.util.ArrayList backends)
                                throws CreateTableException
Description copied from class: CreateTableRule
Pickups backends from the given backends arraylist according to the current rule policy.

Overrides:
getBackends in class CreateTableRule
Parameters:
backends - backends to choose from
Returns:
Arraylist of choosen DatabaseBackend
Throws:
CreateTableException - in some specific implementations (not this one)
See Also:
CreateTableRule.getBackends(ArrayList)

getInformation

public java.lang.String getInformation()
Description copied from class: CreateTableRule
Gives information about the current policy.

Specified by:
getInformation in class CreateTableRule
Returns:
a String value
See Also:
CreateTableRule.getInformation()


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