public class CounterDescriptionModel extends java.lang.Object implements XMLMarshallable
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="CounterOperationType">
<xs:restriction base="xs:string">
<xs:enumeration value="increment"/>
<xs:enumeration value="decrement"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="counterDescription">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="initialValue" type="xs:decimal"/>
<xs:attribute name="counterName" type="xs:string"/>
<xs:attribute name="isTransient" type="xs:boolean" use="optional" default="false"/>
<xs:attribute name="operation" type="CounterOperationType" use="optional" />
</xs:complexType>
</xs:element>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG_NAME
The value of that constant is the XML tag name of the counter description.
|
| Constructor and Description |
|---|
CounterDescriptionModel()
Constructs an empty counter model.
|
CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue)
Constructs a counter without the mapped counter name.
|
CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
boolean isTransient)
Constructs a counter without the mapped counter name.
|
CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
boolean isTransient,
DistributedCounterOperationType distributedCounterOperationType)
Constructs a counter without the mapped counter name with distributedCounterOperationType.
|
CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
java.lang.String counterName)
Constructs a full counter.
|
CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
java.lang.String counterName,
boolean isTransient,
DistributedCounterOperationType distributedCounterOperationType)
Constructs a full counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String name,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
boolean |
checkValidity()
Returns true if the counter is valid.
|
java.lang.String |
getCounterName()
Returns the mapped counter name.
|
java.lang.String |
getDescription()
Returns the description of the counter.
|
java.math.BigDecimal |
getInitialValue()
Returns the initial value of the counter.
|
java.lang.String |
getName()
Returns the name of the counter.
|
DistributedCounterOperationType |
getOperationType()
Gets the type of distributed counter: increment or decrement.
|
boolean |
isIncrementCounter()
Returns true if the counter is shareable and is of type increment, false otherwise.
|
boolean |
isTransient()
Checks if counter is transient.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setCounterName(java.lang.String counterName)
Sets the mapped counter name.
|
void |
setDescription(java.lang.String description)
Sets the description of the counter.
|
void |
setInitialValue(java.math.BigDecimal initialValue)
Sets the initial value of the counter.
|
void |
setName(java.lang.String name)
Sets the name of the counter.
|
void |
setOperationType(DistributedCounterOperationType operationType)
Sets the operation type of the distributed counter.
|
void |
setTransient()
Sets counter transient.
|
java.lang.String |
validate(java.util.Vector<CounterDescriptionModel> sharedCounters,
boolean link)
Checks if this counter description is valid.
|
public static final java.lang.String TAG_NAME
public CounterDescriptionModel()
public CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.public CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
boolean isTransient)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.isTransient - counter is transient if true, persistent otherwisepublic CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
boolean isTransient,
DistributedCounterOperationType distributedCounterOperationType)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.isTransient - counter is transient if true, persistent otherwisedistributedCounterOperationType - type of distributed counters: increment or decrement, null for persistent counterspublic CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
java.lang.String counterName)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.counterName - the name of the mapped counter.public CounterDescriptionModel(java.lang.String name,
java.lang.String description,
java.math.BigDecimal initialValue,
java.lang.String counterName,
boolean isTransient,
DistributedCounterOperationType distributedCounterOperationType)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.counterName - the name of the mapped counter.isTransient - counter is transient if true, persistent otherwisedistributedCounterOperationType - type of distributed counters: increment or decrement, null for persistent counterspublic java.lang.String getName()
public void setName(java.lang.String name)
name - the name of the counter.public void setDescription(java.lang.String description)
description - the description of the counter.getDescription()public java.lang.String getDescription()
setDescription(String)public java.math.BigDecimal getInitialValue()
public void setInitialValue(java.math.BigDecimal initialValue)
initialValue - the initial value of the counter.public java.lang.String getCounterName()
public void setCounterName(java.lang.String counterName)
counterName - the name of the mapped counter.public boolean isTransient()
public void setTransient()
public DistributedCounterOperationType getOperationType()
DistributedCounterOperationType the type of distributed counters: increment or decrement. Null for persistent counters.public void setOperationType(DistributedCounterOperationType operationType)
operationType - DistributedCounterOperationType the type of distributed counters: increment or decrement. Null for persistent counterspublic boolean isIncrementCounter()
public boolean checkValidity()
public java.lang.String validate(java.util.Vector<CounterDescriptionModel> sharedCounters, boolean link)
sharedCounters - a list of CounterDescriptionModel that represents
the available shared counters.link - true if the counter described by this counter description maps a shared counters, false otherwise.public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String name,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallablename - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into