org.rhq.core.domain.drift
Interface DriftChangeSet<D extends Drift<?,?>>

Type Parameters:
D - A server plugin's Drift implementation
All Known Implementing Classes:
DriftChangeSetDTO, JPADriftChangeSet

public interface DriftChangeSet<D extends Drift<?,?>>

A DriftChangeSet is somewhat similar to a commit in version control systems. It contains information about files being monitored or tracked for drift detection. A change set tells us about files that are added, modified, and deleted.

Agents generate and send change set reports to the RHQ server. This interface provides the contract required for defining and persisting a DriftChangeSet. Drift server plugins are responsible for managing persistence.

Each DriftChangeSet belongs to a particular DriftDefinition which specifies the rules for how drift detection is performed (by the agent). A DriftDefinition is in turn owned by a Resource and a resource can have multiple drift definitions.


Method Summary
 DriftChangeSetCategory getCategory()
          Retturns the category that identifies the change set type.
 Long getCtime()
           
 int getDriftDefinitionId()
          Returns the id of the owning drift definition.
 DriftConfigurationDefinition.DriftHandlingMode getDriftHandlingMode()
          Returns the drift handling mode of the owning drift definition at the time of change set creation.
 Set<D> getDrifts()
           
 String getId()
          Returns a string that uniquely identifies the change set.
 int getResourceId()
          Returns the id of the resource to which the drift definition is assigned.
 int getVersion()
          Every change set must be assigned a version that is unique within the context of the owning DriftDefinition.
 void setCategory(DriftChangeSetCategory category)
          Sets the change set category.
 void setDriftDefinitionId(int id)
          Sets the id of the owning drift definition.
 void setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode driftHandlingMode)
          Sets the drift handling mode for the change set.
 void setDrifts(Set<D> drifts)
           
 void setId(String id)
          Sets the change set id which should be unique.
 void setResourceId(int id)
          Sets the id of the resource to which the drift definition is assigned.
 void setVersion(int version)
          Sets the change set version number.
 

Method Detail

getId

String getId()
Returns a string that uniquely identifies the change set. The format of the string is implementation dependent and as such there is no requirement that the id be stored as a string, only that it has a string representation.

Returns:
A unique id as a string

setId

void setId(String id)
Sets the change set id which should be unique. Implementations are free to store the id in any format.

Parameters:
id - The change set identifier that should be unique

getCtime

Long getCtime()
Returns:
The time that the change set was created

getVersion

int getVersion()
Every change set must be assigned a version that is unique within the context of the owning DriftDefinition. This is analgous to a revision number in a version control system like SVN.

Returns:
The change set version number that is unique within the context of its owning DriftDefinition.

setVersion

void setVersion(int version)
Sets the change set version number. Note that change set version numbers must be unique within the context of the owning DriftDefinition. Change sets should be assigned version numbers in increasing order. The first change set saved should have a version of N, the second should have a value of N + 1, etc.

Parameters:
version - The version number.

getCategory

DriftChangeSetCategory getCategory()
Retturns the category that identifies the change set type.

Returns:
The change set category
See Also:
DriftChangeSetCategory

setCategory

void setCategory(DriftChangeSetCategory category)
Sets the change set category.

Parameters:
category - The category that identifies the change set type
See Also:
DriftChangeSetCategory

getDriftHandlingMode

DriftConfigurationDefinition.DriftHandlingMode getDriftHandlingMode()
Returns the drift handling mode of the owning drift definition at the time of change set creation. Because the value set on the owning drift definition can change, the value must be stored with the change set such that it can be applied consistently when handling the associated drift.

Returns:
The DriftDefinition.DriftHandlingMode mode

setDriftHandlingMode

void setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode driftHandlingMode)
Sets the drift handling mode for the change set. It should be set to the owning drift definition's drift handling mode at the time of change set creation. Because the value set on the owning drift definition can change, the value must be stored with the change set such that it can be applied consistently when handling the associated drift.

Parameters:
driftHandlingMode - The DriftDefinition.DriftHandlingMode mode

getDriftDefinitionId

int getDriftDefinitionId()
Returns the id of the owning drift definition. Note that while server plugins are responsible for managing the persistence of change sets, the RHQ server manages the persistence of the owning drift definition.

Returns:
The DriftDefinition id

setDriftDefinitionId

void setDriftDefinitionId(int id)
Sets the id of the owning drift definition. Note that while server plugins are responsible for managing the persistence of change sets, the RHQ server manages the persistence of the drift definition.

Parameters:
id - The DriftDefinition id

getResourceId

int getResourceId()
Returns the id of the resource to which the drift definition is assigned. Note that the RHQ server and not drift server plugins manage the persistence of the resource.

Returns:
The id of the resource to which the drift definition belongs

setResourceId

void setResourceId(int id)
Sets the id of the resource to which the drift definition is assigned. Note that the RHQ server and not the drift server plugins manage the persistence of the resource

Parameters:
id - The Resource id

getDrifts

Set<D> getDrifts()
Returns:
The entries that comprise this change set

setDrifts

void setDrifts(Set<D> drifts)
Parameters:
drifts - The entries that make up this change set


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