CodeBeamer 5.4.0.1-RC API

com.intland.codebeamer.persistence.dto
Class TrackerItemEscalationRuleDto

java.lang.Object
  extended by com.intland.codebeamer.persistence.dto.base.IdentifiableDto
      extended by com.intland.codebeamer.persistence.dto.TrackerItemEscalationRuleDto
All Implemented Interfaces:
BaseDto, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
ReadOnlyEscalationRuleDto

public class TrackerItemEscalationRuleDto
extends IdentifiableDto

The definition of a tracker item escalation rule.

See Also:
Serialized Form

Nested Class Summary
static class TrackerItemEscalationRuleDto.Anchor
          The anchor defines how to compute the escalation firing date and time based on the specified time offset and the (Date) value/last modification date of the tracker item anchor field
 
Nested classes/interfaces inherited from class com.intland.codebeamer.persistence.dto.base.IdentifiableDto
IdentifiableDto.IdComparator
 
Field Summary
static java.lang.Integer DAYS
           
static java.lang.Integer HOURS
           
static java.lang.Integer MINUTES
           
static int NOTIFY_ADDITIONAL_LISTENERS
          Send escalation notifications to the named additional listeners
static int NOTIFY_ISSUE_ASSIGNEES
          Send escalation notifications to users assigned to the issue
static int NOTIFY_ISSUE_SUBMITTER
          Send escalation notifications to the issue submitter
static int NOTIFY_ISSUE_SUPERVISORS
          Send escalation notifications to users supervising the issue
static java.lang.Integer SECONDS
          TimeUnits for the offset calculation
 
Constructor Summary
TrackerItemEscalationRuleDto()
          Create a default TrackerItemEscalationRuleDto
TrackerItemEscalationRuleDto(java.lang.Integer trackerId, NamedDto predicate, int level)
          Create a new TrackerItemEscalationRuleDto with the specified key attributes
TrackerItemEscalationRuleDto(java.lang.Integer trackerId, NamedDto predicate, int level, java.lang.String offset, java.lang.Integer unit, TrackerItemEscalationRuleDto.Anchor anchor, java.lang.Integer fieldId, java.lang.Integer statusId)
          Create a new TrackerItemEscalationRuleDto with the specified attributes
TrackerItemEscalationRuleDto(TrackerItemEscalationRuleDto base)
          TrackerItemEscalationRuleDto copy constructor
 
Method Summary
 int compareTo(java.lang.Object obj)
          TrackerItemEscalationRuleDtos are compared by tracker id, predicate name and level
 boolean equals(java.lang.Object obj)
          Two TrackerItemEscalationRuleDtos are equal, if their tracker id, predicate id and level are equal
 TrackerItemEscalationRuleDto.Anchor getAnchor()
          Get the TrackerItemEscalationRuleDto.Anchor relation between the specified offset and the tracker item anchor field
 java.lang.Integer getAudience()
          Get the target audience for notification mails emitted by this notification rule.
 TrackerItemCompiledExpression<java.lang.Number> getCompiledOffset()
          Get the compiled script/formula to calculate the time offset
 java.lang.Integer getFieldId()
          Get the ID of the escalation anchor field.
 java.lang.Integer getId()
          Get the ID of the tracker, this escalation rule was declared at
 int getLevel()
          Get the escalation level
 java.util.List<? extends NamedDto> getListeners()
          Get the list of additional listeners (other than issue submitter/assignees/supervisors) for notifications emitted by this rule
 java.lang.String getOffset()
          Get the formula to compute the time offset measured in unit, relative to the field according to anchor
static long getOffset(java.lang.Number offset, java.lang.Integer unit, java.util.concurrent.TimeUnit inUnit)
          Convert the specified offset into the specified result unit Note: Converting to/from days is with 24h/day, which is not appropriate for working time calculations!
 java.lang.Number getOffset(TrackerLayoutDto tracker, TrackerItemDto item)
          Compute the time offset of this rule for the specified item
 long getOffset(TrackerLayoutDto tracker, TrackerItemDto item, java.util.concurrent.TimeUnit inUnit)
          Get the computed time offset of this rule for the specified item, relative to the anchor field, in the specified unit Note: Converting to/from days is with 24h/day, which is not appropriate for working time calculations!
 java.lang.Boolean getOnlyMembers()
          Check if only direct project members in the specified role should be notified (true), or also indirect members (false)
 NamedDto getPredicate()
          Get the tracker item filter/predicate, to determine which tracker items are subject of escalation
 java.lang.Integer getStatusId()
          Get the ID of the escalation target status (if any).
 java.lang.Integer getUnit()
          Get the time unit of the specified offset
 boolean isAudience(int bits)
          Check if all of the specified bits are set in the audience mask
 void setAnchor(TrackerItemEscalationRuleDto.Anchor anchor)
          Set how to compute the escalation firing date and time based on the specified offset and tracker item anchor field
 void setAudience(java.lang.Integer audience)
          Set the target audience for notification mails emitted by this notification rule.
 void setCompiledOffset(TrackerItemCompiledExpression<java.lang.Number> compiledOffset)
          Set the compiled script/formula to calculate the time offset
 void setFieldId(java.lang.Integer fieldId)
          Set the ID of the anchor field for this escalation level.
 void setLevel(int level)
          Set the escalation level
 void setListeners(java.util.List<? extends NamedDto> listeners)
          Set the list of additional listeners (other than issue submitter/assignees/supervisors) for notifications emitted by this rule
 void setOffset(java.lang.String offset)
          Set the formula to compute the time offset measured in unit, relative to the field according to anchor
 void setOnlyMembers(java.lang.Boolean onlyMembers)
          Set whether only direct project members in the specified role should be notified (true), or also indirect members (false)
 void setPredicate(NamedDto predicate)
          Set the tracker item filter/predicate, to determine which tracker items are subject of escalation
 void setStatusId(java.lang.Integer statusId)
          Set the ID of the escalation target status (if any).
 void setUnit(java.lang.Integer unit)
          Set the time unit of the specified offset, defaults to HOURS if null
 java.lang.String toString()
           
 
Methods inherited from class com.intland.codebeamer.persistence.dto.base.IdentifiableDto
clone, compare, compareInteger, equals, hashCode, hashCode, setId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NOTIFY_ISSUE_SUBMITTER

public static final int NOTIFY_ISSUE_SUBMITTER
Send escalation notifications to the issue submitter

See Also:
Constant Field Values

NOTIFY_ISSUE_ASSIGNEES

public static final int NOTIFY_ISSUE_ASSIGNEES
Send escalation notifications to users assigned to the issue

See Also:
Constant Field Values

NOTIFY_ISSUE_SUPERVISORS

public static final int NOTIFY_ISSUE_SUPERVISORS
Send escalation notifications to users supervising the issue

See Also:
Constant Field Values

NOTIFY_ADDITIONAL_LISTENERS

public static final int NOTIFY_ADDITIONAL_LISTENERS
Send escalation notifications to the named additional listeners

See Also:
Constant Field Values

SECONDS

public static final java.lang.Integer SECONDS
TimeUnits for the offset calculation


MINUTES

public static final java.lang.Integer MINUTES

HOURS

public static final java.lang.Integer HOURS

DAYS

public static final java.lang.Integer DAYS
Constructor Detail

TrackerItemEscalationRuleDto

public TrackerItemEscalationRuleDto()
Create a default TrackerItemEscalationRuleDto


TrackerItemEscalationRuleDto

public TrackerItemEscalationRuleDto(java.lang.Integer trackerId,
                                    NamedDto predicate,
                                    int level)
Create a new TrackerItemEscalationRuleDto with the specified key attributes

Parameters:
trackerId - is the ID of the TrackerDto the item escalation belongs to
level - is the escalation level number [1 ... n] (must be unique within tracker)
predicate - is the tracker item filter/predicate, to determine which tracker items are subject of escalation

TrackerItemEscalationRuleDto

public TrackerItemEscalationRuleDto(java.lang.Integer trackerId,
                                    NamedDto predicate,
                                    int level,
                                    java.lang.String offset,
                                    java.lang.Integer unit,
                                    TrackerItemEscalationRuleDto.Anchor anchor,
                                    java.lang.Integer fieldId,
                                    java.lang.Integer statusId)
Create a new TrackerItemEscalationRuleDto with the specified attributes

Parameters:
trackerId - is the ID of the TrackerDto the item escalation belongs to
level - is the escalation level number [1 ... n] (must be unique within tracker)
predicate - is the tracker item filter/predicate, to determine which tracker items are subject of escalation
offset - is the formula to calculate the time offset in the specified unit, relative to the specified field according to anchor
unit - is the time unit of the specified offset, defaults to HOURS if null
anchor - is the TrackerItemEscalationRuleDto.Anchor that determines the relation between the specified offset and tracker item field
fieldId - is the ID of the anchor field of this escalation level. The escalation firing date and time is calculated relative to this field's value or last modification time, based on offset, unit and anchor
statusId - is the ID of the new status for the target tracker item upon escalation, or null to not change the item status

TrackerItemEscalationRuleDto

public TrackerItemEscalationRuleDto(TrackerItemEscalationRuleDto base)
TrackerItemEscalationRuleDto copy constructor

Parameters:
base - escalation level to copy
Method Detail

getId

public java.lang.Integer getId()
Get the ID of the tracker, this escalation rule was declared at

Overrides:
getId in class IdentifiableDto
Returns:
the ID of the declaring tracker for this escalation rule

getPredicate

public NamedDto getPredicate()
Get the tracker item filter/predicate, to determine which tracker items are subject of escalation

Returns:
the tracker item filter/predicate, to determine which tracker items are subject of escalation

setPredicate

public void setPredicate(NamedDto predicate)
Set the tracker item filter/predicate, to determine which tracker items are subject of escalation

Parameters:
predicate - is the tracker item filter/predicate, to determine which tracker items are subject of escalation

getLevel

public int getLevel()
Get the escalation level

Returns:
the escalation level

setLevel

public void setLevel(int level)
Set the escalation level

Parameters:
level - is the escalation level, that must be unique within a tracker and predicate/group

getOffset

public java.lang.String getOffset()
Get the formula to compute the time offset measured in unit, relative to the field according to anchor

Returns:
the formula to compute the time offset in the specified unit, relative to the specified field according to anchor

setOffset

public void setOffset(java.lang.String offset)
Set the formula to compute the time offset measured in unit, relative to the field according to anchor

Parameters:
offset - is the formula to compute the time offset in the specified unit, relative to the specified field according to anchor

getCompiledOffset

public TrackerItemCompiledExpression<java.lang.Number> getCompiledOffset()
Get the compiled script/formula to calculate the time offset

Returns:
the compiled script/formula to calculate the time offset, or null

setCompiledOffset

public void setCompiledOffset(TrackerItemCompiledExpression<java.lang.Number> compiledOffset)
Set the compiled script/formula to calculate the time offset

Parameters:
compiledOffset - is the compiled script/formula to calculate the time offset, or null

getOffset

public java.lang.Number getOffset(TrackerLayoutDto tracker,
                                  TrackerItemDto item)
Compute the time offset of this rule for the specified item

Parameters:
item - is the target item
Returns:
the computed time offset, or null, if no offset specified or offset expression returned null

getOffset

public static long getOffset(java.lang.Number offset,
                             java.lang.Integer unit,
                             java.util.concurrent.TimeUnit inUnit)
Convert the specified offset into the specified result unit Note: Converting to/from days is with 24h/day, which is not appropriate for working time calculations!

Parameters:
offset - to convert
unit - of the offset to convert, defaults to HOURS if null
inUnit - to get the offset in, defaults to TimeUnit.SECONDS if null
Returns:
the offset in the specified resultUnit

getOffset

public long getOffset(TrackerLayoutDto tracker,
                      TrackerItemDto item,
                      java.util.concurrent.TimeUnit inUnit)
Get the computed time offset of this rule for the specified item, relative to the anchor field, in the specified unit Note: Converting to/from days is with 24h/day, which is not appropriate for working time calculations!

Parameters:
tracker - is the target tracker layout
item - is the target item
inUnit - to get the offset in, defaults to TimeUnit.SECONDS if null
Returns:
the computed time offset, relative to the anchor field, in the specified unit

getUnit

public java.lang.Integer getUnit()
Get the time unit of the specified offset

Returns:
the time unit of the specified offset

setUnit

public void setUnit(java.lang.Integer unit)
Set the time unit of the specified offset, defaults to HOURS if null


getAnchor

public TrackerItemEscalationRuleDto.Anchor getAnchor()
Get the TrackerItemEscalationRuleDto.Anchor relation between the specified offset and the tracker item anchor field

Returns:
the TrackerItemEscalationRuleDto.Anchor relation between the specified offset and the tracker item anchor field

setAnchor

public void setAnchor(TrackerItemEscalationRuleDto.Anchor anchor)
Set how to compute the escalation firing date and time based on the specified offset and tracker item anchor field

Parameters:
anchor - is the TrackerItemEscalationRuleDto.Anchor that determines the relation between the specified offset and tracker item field

getFieldId

public java.lang.Integer getFieldId()
Get the ID of the escalation anchor field. The escalation firing date and time is relative to the value/last modification date of this field

Returns:
the ID of the escalation anchor field

setFieldId

public void setFieldId(java.lang.Integer fieldId)
Set the ID of the anchor field for this escalation level. The escalation firing date and time is calculated relative to this field's value or last modification time, based on offset, unit and anchor

Parameters:
fieldId - is the ID of the anchor field for this escalation level

getStatusId

public java.lang.Integer getStatusId()
Get the ID of the escalation target status (if any). The tracker item where the escalation occured will be set to this target

Returns:
the ID of the escalation target status, or null (do not change item status upon escalation)

setStatusId

public void setStatusId(java.lang.Integer statusId)
Set the ID of the escalation target status (if any).

Parameters:
statusId - is the ID of the new status for the target tracker item upon escalation, or null to not change the item status

getAudience

public java.lang.Integer getAudience()
Get the target audience for notification mails emitted by this notification rule. This is a bitmask (logical OR) of
- NOTIFY_ISSUE_SUBMITTER
- NOTIFY_ISSUE_ASSIGNEES
- NOTIFY_ISSUE_SUPERVISORS
- NOTIFY_ADDITIONAL_LISTENERS defined in getListeners()

Returns:
the audience for notification mails emitted by this notification rule

setAudience

public void setAudience(java.lang.Integer audience)
Set the target audience for notification mails emitted by this notification rule. This should be a bitmask (logical OR) of
- NOTIFY_ISSUE_SUBMITTER
- NOTIFY_ISSUE_ASSIGNEES
- NOTIFY_ISSUE_SUPERVISORS
- NOTIFY_ADDITIONAL_LISTENERS defined in getListeners()

Parameters:
audience - is the target audience for notification mails emitted by this notification rule.

isAudience

public boolean isAudience(int bits)
Check if all of the specified bits are set in the audience mask

Returns:
true if all bits are set, otherwise false

getListeners

public java.util.List<? extends NamedDto> getListeners()
Get the list of additional listeners (other than issue submitter/assignees/supervisors) for notifications emitted by this rule

Returns:
the list of additional listeners (users and/or roles) for notifications emitted by this rule

setListeners

public void setListeners(java.util.List<? extends NamedDto> listeners)
Set the list of additional listeners (other than issue submitter/assignees/supervisors) for notifications emitted by this rule

Parameters:
listeners - is a list of additional listeners (users and/or roles) for notifications emitted by this rule

getOnlyMembers

public java.lang.Boolean getOnlyMembers()
Check if only direct project members in the specified role should be notified (true), or also indirect members (false)

Returns:
true if only direct project members in the specified role should be notified, or false to also notify indirect members

setOnlyMembers

public void setOnlyMembers(java.lang.Boolean onlyMembers)
Set whether only direct project members in the specified role should be notified (true), or also indirect members (false)

Parameters:
onlyMembers - true if only direct project members in the specified role should be notified, or false to also notify indirect members

equals

public boolean equals(java.lang.Object obj)
Two TrackerItemEscalationRuleDtos are equal, if their tracker id, predicate id and level are equal

Overrides:
equals in class IdentifiableDto

compareTo

public int compareTo(java.lang.Object obj)
TrackerItemEscalationRuleDtos are compared by tracker id, predicate name and level

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class IdentifiableDto

toString

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

CodeBeamer 5.4.0.1-RC API

Copyright © 2006-2009 Intland Software. All rights reserved.