org.ow2.carol.cmi.lb.data
Class LBPolicyData

java.lang.Object
  extended by org.ow2.carol.cmi.lb.data.LBPolicyData
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

@ThreadSafe
public final class LBPolicyData
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Contains data for a policy of load-balancing.

Author:
The new CMI team
See Also:
Serialized Form

Constructor Summary
LBPolicyData(java.lang.String policyType, java.lang.String strategyType, java.util.Map<java.lang.String,java.lang.Object> properties)
          Constructs data for load-balancing with the specified policy, strategy and properties.
LBPolicyData(java.lang.String policyType, java.lang.String strategyType, java.util.Map<java.lang.String,java.lang.Object> properties, long dateOfProperties)
          Constructs data for load-balancing with the specified policy, strategy and properties.
 
Method Summary
 LBPolicyData clone()
           
 boolean equals(java.lang.Object object)
           
 long getDateOfProperties()
           
 java.lang.String getPolicyType()
           
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Returns the value of the property with the given name.
 java.lang.Object getProperty(java.lang.String propertyName)
          Returns the value of the property with the given name.
 java.lang.String getStrategyType()
           
 void setPolicyType(java.lang.String lbPolicyType)
          Sets the type of policy.
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
          Set new properties to the policy (remove the previous).
 void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
          Adds a property to the policy.
 void setStrategyType(java.lang.String lbStrategyType)
          Sets the type of strategy.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LBPolicyData

public LBPolicyData(java.lang.String policyType,
                    java.lang.String strategyType,
                    java.util.Map<java.lang.String,java.lang.Object> properties)
Constructs data for load-balancing with the specified policy, strategy and properties. Generates a number of version for each datum.

Parameters:
policyType - a type of LB policy
strategyType - a type of LB strategy
properties - properties for the given LB policy

LBPolicyData

public LBPolicyData(java.lang.String policyType,
                    java.lang.String strategyType,
                    java.util.Map<java.lang.String,java.lang.Object> properties,
                    long dateOfProperties)
Constructs data for load-balancing with the specified policy, strategy and properties. Uses the current number of version for each datum.

Parameters:
policyType - a type of LB policy
strategyType - a type of LB strategy
properties - properties for the given LB policy
dateOfProperties - a date of properties
Method Detail

getPolicyType

public java.lang.String getPolicyType()
Returns:
the type of policy

setPolicyType

public void setPolicyType(java.lang.String lbPolicyType)
Sets the type of policy.

Parameters:
lbPolicyType - a type of policy

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Returns the value of the property with the given name.

Returns:
properties for policy

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Returns the value of the property with the given name.

Parameters:
propertyName - a name of a property
Returns:
the value of the property with the given name

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Set new properties to the policy (remove the previous).

Parameters:
properties - properties

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object propertyValue)
Adds a property to the policy.

Parameters:
propertyName - a name of a property
propertyValue - a value of a property

getDateOfProperties

public long getDateOfProperties()
Returns:
the date of properties

getStrategyType

public java.lang.String getStrategyType()
Returns:
the type of strategy for load-balancing

setStrategyType

public void setStrategyType(java.lang.String lbStrategyType)
Sets the type of strategy.

Parameters:
lbStrategyType - a type of policy

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public LBPolicyData clone()
                   throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException


Copyright © 2007 OW2 Consortium. All Rights Reserved.