uk.ac.soton.itinnovation.grid.service.types
Class PricingTerm

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.types.PricingTerm
All Implemented Interfaces:
Comparable<PricingTerm>

public class PricingTerm
extends Object
implements Comparable<PricingTerm>

PricingTerm A basic resource pricing system where a set of pricing terms are applied to the usage on an SLA. Several pricing terms may apply to the same metric, allowing for banded pricing structures (e.g. first 10MB free, $1/MB for 10-100MB, $2/MB for 100MB upwards). The interval charged for is [lowerBound, upperBound).


Field Summary
 PricingTermType type
           
 
Constructor Summary
PricingTerm()
           
PricingTerm(Metric metric, BigDecimal price, String currency, double lower, double upper, String d, PricingTermType type)
           
PricingTerm(PricingTerm p)
          Deprecated. 
 
Method Summary
 int compareTo(PricingTerm other)
           
 PricingTerm copyWithNullId()
          Copy the pricing term without the hibernate id
 boolean equalsByValue(Object obj, boolean includeDatabaseIdentity)
           
 String getCurrency()
           
 String getDescription()
           
 Long getId()
           
 double getLowerBound()
           
 Metric getMetric()
           
 BigDecimal getPrice()
           
 String getType()
           
static TypeDesc getTypeDesc()
          Return type metadata object.
 double getUpperBound()
           
 int hashCodeByValue(boolean includeDatabaseIdentity)
           
 String prettyPrint()
           
 String prettyPrint(boolean html)
           
 void setCurrency(String argCurrency)
           
 void setDescription(String d)
           
 void setId(Long argId)
           
 void setLowerBound(double argLowerBound)
           
 void setMetric(Metric argMetric)
           
 void setPrice(BigDecimal argPrice)
           
 void setType(String argType)
           
 void setUpperBound(double argUpperBound)
          If this is set to -1 then it is taken as +infinity
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public PricingTermType type
Constructor Detail

PricingTerm

public PricingTerm()

PricingTerm

public PricingTerm(Metric metric,
                   BigDecimal price,
                   String currency,
                   double lower,
                   double upper,
                   String d,
                   PricingTermType type)

PricingTerm

@Deprecated
public PricingTerm(PricingTerm p)
Deprecated. 

Copy the pricing term without the hibernate id

Method Detail

copyWithNullId

public PricingTerm copyWithNullId()
Copy the pricing term without the hibernate id


getId

public Long getId()

setId

public void setId(Long argId)

getMetric

public Metric getMetric()

setMetric

public void setMetric(Metric argMetric)

getPrice

public BigDecimal getPrice()

setPrice

public void setPrice(BigDecimal argPrice)

getCurrency

public String getCurrency()

setCurrency

public void setCurrency(String argCurrency)

getLowerBound

public double getLowerBound()

setLowerBound

public void setLowerBound(double argLowerBound)

getUpperBound

public double getUpperBound()

setUpperBound

public void setUpperBound(double argUpperBound)
If this is set to -1 then it is taken as +infinity


getDescription

public String getDescription()

setDescription

public void setDescription(String d)

getType

public String getType()

setType

public void setType(String argType)

prettyPrint

public String prettyPrint(boolean html)

prettyPrint

public String prettyPrint()

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(PricingTerm other)
Specified by:
compareTo in interface Comparable<PricingTerm>

equalsByValue

public boolean equalsByValue(Object obj,
                             boolean includeDatabaseIdentity)

hashCodeByValue

public int hashCodeByValue(boolean includeDatabaseIdentity)

getTypeDesc

public static TypeDesc getTypeDesc()
Return type metadata object.



Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.