public class LicenseComponent extends Object implements Serializable
Simple container class for storing function, version, and capacity inside LicenseInfo objects.
Constructor and Description |
---|
LicenseComponent(String function,
String version,
long capacity,
boolean hardLimited)
Create a new LicenseComponent with the specified function, version, and capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
checkValidity()
Throws a LicenseException if this LicenseComponent is not valid.
|
long |
getCapacity()
Returns the capacity for this LicenseComponent.
|
String |
getFunction()
Returns the function for this LicenseComponent.
|
boolean |
getHardLimited()
Returns whether the capacity of this LicenseComponent can be exceeded or not.
|
String |
getVersion()
Returns the version for this LicenseComponent.
|
String |
toString() |
public LicenseComponent(String function, String version, long capacity, boolean hardLimited) throws LicenseException
Create a new LicenseComponent with the specified function, version, and capacity. A LicenseException will be thrown if the license component is not valid (see checkValidity()).
function
- the functionversion
- the versioncapacity
- the capacityhardLimited
- whether the capacity of the license can be exceeded (false) or not (true).LicenseException
- if an invalid function, version, or capacity was specified.public void checkValidity() throws LicenseException
Throws a LicenseException if this LicenseComponent is not valid. This can be the case when the function or version are specified as null or empty, or a negative capacity has been specified.
LicenseException
public String getFunction()
Returns the function for this LicenseComponent. This will always return a non-empty string.
public String getVersion()
Returns the version for this LicenseComponent. This will always return a non-empty string.
public long getCapacity()
Returns the capacity for this LicenseComponent. This will always be a non-negative value.
public boolean getHardLimited()
Returns whether the capacity of this LicenseComponent can be exceeded or not. If this is set to true, then the SLEE will limit throughput for this function/version to the capacity. If it is set to false, then the SLEE will warn when the capacity has been exceeded (but not drop any events).