org.rhq.core.domain.drift
Class DriftDefinitionTemplate

java.lang.Object
  extended by org.rhq.core.domain.drift.DriftDefinitionTemplate
All Implemented Interfaces:
Serializable

public class DriftDefinitionTemplate
extends Object
implements Serializable

A drift definition template (or drift template for short) is a drift definition that applies at the type level like an alert template. Drift templates can be defined in plugin descriptors as a way to provide suggested and/or common definitions for users wanting to monitor resources of that type. Users can also create templates from admin section of the UI where templates can be managed. Template can be created from existing definitions.

A pinned drift template is pinned to a specific snapshot and applies at the type level. A pinned template can be created from an existing snapshot that belongs to a particular resource. Definitions created from a pinned template are pinned as well and use the template's snapshot as their snapshots.

When a pinned template is deleted, all definitions created from said template are deleted as well. With an unpinned template however, the definitions can outlive the template.

See Also:
DriftDefinition, Serialized Form

Constructor Summary
DriftDefinitionTemplate()
           
 
Method Summary
 void addDriftDefinition(DriftDefinition definition)
           
 Configuration createConfiguration()
           
 DriftDefinition createDefinition()
           
 boolean equals(Object o)
          Equality for drift templates is defined as having the same resource type and the same name.
 String getChangeSetId()
          If the template is pinned this will be set to the id of the pinned snapshot/change set.
 Configuration getConfiguration()
           
 Long getCtime()
           
 String getDescription()
           
 Set<DriftDefinition> getDriftDefinitions()
           
 int getId()
           
 String getName()
           
 ResourceType getResourceType()
           
 DriftDefinition getTemplateDefinition()
           
 int hashCode()
           
 boolean isPinned()
           
 boolean isUserDefined()
           
 void removeDriftDefinition(DriftDefinition definition)
           
 void setChangeSetId(String changeSetId)
           
 void setCtime(Long ctime)
           
 void setDescription(String description)
           
 void setId(int id)
           
 void setName(String name)
           
 void setResourceType(ResourceType type)
           
 void setTemplateDefinition(DriftDefinition templateDefinition)
           
 void setUserDefined(boolean isUserDefined)
           
 String toString()
           
 String toString(boolean verbose)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DriftDefinitionTemplate

public DriftDefinitionTemplate()
Method Detail

getId

public int getId()

setId

public void setId(int id)

getCtime

public Long getCtime()

setCtime

public void setCtime(Long ctime)

getName

public String getName()

setName

public void setName(String name)

getDescription

public String getDescription()

isUserDefined

public boolean isUserDefined()

setUserDefined

public void setUserDefined(boolean isUserDefined)

setDescription

public void setDescription(String description)

getResourceType

public ResourceType getResourceType()

setResourceType

public void setResourceType(ResourceType type)

getConfiguration

public Configuration getConfiguration()

getTemplateDefinition

public DriftDefinition getTemplateDefinition()

setTemplateDefinition

public void setTemplateDefinition(DriftDefinition templateDefinition)

getChangeSetId

public String getChangeSetId()
If the template is pinned this will be set to the id of the pinned snapshot/change set. Note that change sets are managed by the drift server plugin.

Returns:
The id of the pinned change set or null if the template is not pinned.

setChangeSetId

public void setChangeSetId(String changeSetId)
Parameters:
changeSetId - The id of the change set to which the template is pinned

getDriftDefinitions

public Set<DriftDefinition> getDriftDefinitions()

addDriftDefinition

public void addDriftDefinition(DriftDefinition definition)

removeDriftDefinition

public void removeDriftDefinition(DriftDefinition definition)

createConfiguration

public Configuration createConfiguration()

createDefinition

public DriftDefinition createDefinition()

isPinned

public boolean isPinned()

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean verbose)

equals

public boolean equals(Object o)
Equality for drift templates is defined as having the same resource type and the same name.

Overrides:
equals in class Object
Parameters:
o - The object against which to compare
Returns:
True if the arugment is a DriftDefinitionTemplate and has the same resource type and name as this template.

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.