org.rhq.enterprise.server.drift
Interface DriftManagerRemote

All Known Subinterfaces:
DriftManagerLocal
All Known Implementing Classes:
DriftManagerBean

public interface DriftManagerRemote


Method Summary
 void deleteDriftDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext entityContext, String driftDefName)
          Remove the provided driftDef (identified by name) on the specified entityContext.
 org.rhq.core.domain.util.PageList<? extends org.rhq.core.domain.drift.DriftChangeSet<?>> findDriftChangeSetsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.DriftChangeSetCriteria criteria)
          Standard criteria based fetch method
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.DriftDefinition> findDriftDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.DriftDefinitionCriteria criteria)
           
 org.rhq.core.domain.util.PageList<? extends org.rhq.core.domain.drift.Drift<?,?>> findDriftsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.DriftCriteria criteria)
          Standard criteria based fetch method
 org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.Drift<?,?> drift)
          Generates a unified diff of the two files references by drift.
 org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.Drift<?,?> drift1, org.rhq.core.domain.drift.Drift<?,?> drift2)
          Generates a unified diff of the two files referenced by drift1 and drift2.
 org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiffByIds(org.rhq.core.domain.auth.Subject subject, String driftId1, String driftId2)
          Generates a unified diff of the two file versions referenced by drift ids.
 byte[] getDriftFileAsByteArray(org.rhq.core.domain.auth.Subject subject, String hash)
           
 String getDriftFileBits(org.rhq.core.domain.auth.Subject subject, String hash)
          Returns the content associated with the specified hash as a string
 org.rhq.core.domain.drift.DriftSnapshot getSnapshot(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.DriftSnapshotRequest request)
          Calculate and return requested Drift Snapshot.
 void pinSnapshot(org.rhq.core.domain.auth.Subject subject, int driftDefId, int snapshotVersion)
           
 void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext entityContext, org.rhq.core.domain.drift.DriftDefinition driftDef)
           Saves or updates the provided drift definition.
 

Method Detail

deleteDriftDefinition

void deleteDriftDefinition(org.rhq.core.domain.auth.Subject subject,
                           org.rhq.core.domain.common.EntityContext entityContext,
                           String driftDefName)
Remove the provided driftDef (identified by name) on the specified entityContext. Agents, if available, will be notified of the change.

Parameters:
subject -
entityContext -
driftDefName -

findDriftChangeSetsByCriteria

org.rhq.core.domain.util.PageList<? extends org.rhq.core.domain.drift.DriftChangeSet<?>> findDriftChangeSetsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                       org.rhq.core.domain.criteria.DriftChangeSetCriteria criteria)
                                                                                                                       throws Exception
Standard criteria based fetch method

Parameters:
subject -
criteria -
Returns:
The DriftChangeSets matching the criteria
Throws:
Exception

findDriftDefinitionsByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.DriftDefinition> findDriftDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                            org.rhq.core.domain.criteria.DriftDefinitionCriteria criteria)

findDriftsByCriteria

org.rhq.core.domain.util.PageList<? extends org.rhq.core.domain.drift.Drift<?,?>> findDriftsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                       org.rhq.core.domain.criteria.DriftCriteria criteria)
                                                                                                       throws Exception
Standard criteria based fetch method

Parameters:
subject -
criteria -
Returns:
The Drifts matching the criteria
Throws:
Exception

generateUnifiedDiff

org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject,
                                                             org.rhq.core.domain.drift.Drift<?,?> drift)
Generates a unified diff of the two files references by drift. In the case of a modified file, a Drift object references the current and previous versions of the file. This method generates a diff of the two versions.

Parameters:
drift - Specifies the two files that will be compared
Returns:
A report containing a unified diff of the two versions of the file referenced by drift

generateUnifiedDiff

org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject,
                                                             org.rhq.core.domain.drift.Drift<?,?> drift1,
                                                             org.rhq.core.domain.drift.Drift<?,?> drift2)
Generates a unified diff of the two files referenced by drift1 and drift2. More specifically, the files referenced by Drift.getNewDriftFile() are compared.

Parameters:
drift1 - References the first file to be compared
drift2 - References the second file to be compared
Returns:
A report containing a unified diff of the two files compared

generateUnifiedDiffByIds

org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiffByIds(org.rhq.core.domain.auth.Subject subject,
                                                                  String driftId1,
                                                                  String driftId2)
Generates a unified diff of the two file versions referenced by drift ids.

Parameters:
drift1Id - the "new" version of the first drift
drift2Id - the "new" version of the second drift
Returns:
A report containing a unified diff of the two versions of the file referenced by drift

getDriftFileBits

String getDriftFileBits(org.rhq.core.domain.auth.Subject subject,
                        String hash)
Returns the content associated with the specified hash as a string

Parameters:
hash - The hash the uniquely identifies the requested content
Returns:
The content as a string

getDriftFileAsByteArray

byte[] getDriftFileAsByteArray(org.rhq.core.domain.auth.Subject subject,
                               String hash)

getSnapshot

org.rhq.core.domain.drift.DriftSnapshot getSnapshot(org.rhq.core.domain.auth.Subject subject,
                                                    org.rhq.core.domain.drift.DriftSnapshotRequest request)
Calculate and return requested Drift Snapshot.

Parameters:
subject -
request -
Returns:
The DriftSnapshot Not null but version is set to -1 if the drift definition does not yet have any snapshots or there are no snapshots that meet the requested snapshot version constraints.
Throws:
IllegalArgumentException - if the specified drift definition does not exist

pinSnapshot

void pinSnapshot(org.rhq.core.domain.auth.Subject subject,
                 int driftDefId,
                 int snapshotVersion)

updateDriftDefinition

void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject,
                           org.rhq.core.domain.common.EntityContext entityContext,
                           org.rhq.core.domain.drift.DriftDefinition driftDef)

Saves or updates the provided drift definition. If the definition, identified by name, already exists, an update is performed; otherwise, a new drift definition is saved. Agents if available will be notified of the change. If agents are unreachable, the definition will still be saved/updated. Changes will then propagate to agents the next time they do an inventory sync.

Several validation checks are performed before the definition is persisted. If it is a new definition, the following checks are performed:

For new and existing definitions these additional checks are performed:

Parameters:
subject -
entityContext -
driftDef -


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