org.rhq.enterprise.server.drift
Interface DriftManagerLocal

All Superinterfaces:
DriftManagerRemote
All Known Implementing Classes:
DriftManagerBean

public interface DriftManagerLocal
extends DriftManagerRemote


Method Summary
 void addChangeSet(org.rhq.core.domain.auth.Subject subject, int resourceId, long zipSize, InputStream zipStream)
          This method initiates an out-of-band (JMS-Based) server-side pull of the change-set file.
 void addFiles(org.rhq.core.domain.auth.Subject subject, int resourceId, String driftDefName, String token, long zipSize, InputStream zipStream)
          This method initiates an out-of-band (JMS-Based) server-side pull of the drift file zip.
 void deleteResourceDriftDefinition(org.rhq.core.domain.auth.Subject subject, int resourceId, int driftDefId)
          This is for internal use only - do not call it unless you know what you are doing.
 void detectDrift(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, org.rhq.core.domain.drift.DriftDefinition driftDef)
          One time on-demand request to detect drift on the specified entities, using the supplied def.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.DriftComposite> findDriftCompositesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.DriftCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.DriftDefinitionComposite> findDriftDefinitionCompositesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.DriftDefinitionCriteria criteria)
           
 org.rhq.core.domain.drift.DriftDefinition getDriftDefinition(org.rhq.core.domain.auth.Subject subject, int driftDefId)
          Get the specified drift definition.
 org.rhq.core.domain.drift.DriftDetails getDriftDetails(org.rhq.core.domain.auth.Subject subject, String driftId)
          Returns an object that encapsulates the information needed for viewing drift details
 org.rhq.core.domain.drift.DriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject, String hashId)
           
 String getDriftFileBits(org.rhq.core.domain.auth.Subject subject, String hash)
          Returns the content associated with the specified hash as a string
 boolean isBinaryFile(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.Drift<?,?> drift)
           
 String persistSnapshot(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.DriftSnapshot snapshot, org.rhq.core.domain.drift.DriftChangeSet<? extends org.rhq.core.domain.drift.Drift<?,?>> changeSet)
           
 void processRepeatChangeSet(int resourceId, String driftDefName, int version)
           
 void purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject, int resourceId, String driftDefName)
          When a user wants to completely remove all data related to a drift definition, this method will be called to give the plugin a chance to clean up any data related to the drift definition that is going to be deleted.
 int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject, long purgeMillis)
          This will remove all drift files that are no longer referenced by drift entries.
 DriftChangeSetSummary saveChangeSet(org.rhq.core.domain.auth.Subject subject, int resourceId, File changeSetZip)
           
 void saveChangeSetContent(org.rhq.core.domain.auth.Subject subject, int resourceId, String driftDefName, String token, File changeSetFilesZip)
           
 void saveChangeSetFiles(org.rhq.core.domain.auth.Subject subject, File changeSetFilesZip)
           
 void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.DriftDefinition driftDefinition)
           
 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.
 
Methods inherited from interface org.rhq.enterprise.server.drift.DriftManagerRemote
deleteDriftDefinition, findDriftChangeSetsByCriteria, findDriftDefinitionsByCriteria, findDriftsByCriteria, generateUnifiedDiff, generateUnifiedDiff, generateUnifiedDiffByIds, getDriftFileAsByteArray, getSnapshot, pinSnapshot
 

Method Detail

addChangeSet

void addChangeSet(org.rhq.core.domain.auth.Subject subject,
                  int resourceId,
                  long zipSize,
                  InputStream zipStream)
                  throws Exception
This method initiates an out-of-band (JMS-Based) server-side pull of the change-set file. Upon successful upload of the change-set, it is processed. This may in turn generated requests for drift files to be persisted.

Parameters:
resourceId - The resource for which the change-set is being reported.
zipSize - The size of the zip waiting to be streamed.
zipStream - The change-set zip file stream
Throws:
Exception

addFiles

void addFiles(org.rhq.core.domain.auth.Subject subject,
              int resourceId,
              String driftDefName,
              String token,
              long zipSize,
              InputStream zipStream)
              throws Exception
This method initiates an out-of-band (JMS-Based) server-side pull of the drift file zip. Upon successful upload of the zip, the files are stored.

Parameters:
resourceId - The resource from which the drift file is being supplied.
zipSize - The size of the zip waiting to be streamed.
zipStream - The drift files zip file stream
Throws:
Exception

deleteResourceDriftDefinition

void deleteResourceDriftDefinition(org.rhq.core.domain.auth.Subject subject,
                                   int resourceId,
                                   int driftDefId)
This is for internal use only - do not call it unless you know what you are doing.


detectDrift

void detectDrift(org.rhq.core.domain.auth.Subject subject,
                 org.rhq.core.domain.common.EntityContext context,
                 org.rhq.core.domain.drift.DriftDefinition driftDef)
One time on-demand request to detect drift on the specified entities, using the supplied def.

Parameters:
entityContext -
driftDef -
Throws:
RuntimeException

findDriftCompositesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.DriftComposite> findDriftCompositesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                          org.rhq.core.domain.criteria.DriftCriteria criteria)

findDriftDefinitionCompositesByCriteria

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

getDriftDefinition

org.rhq.core.domain.drift.DriftDefinition getDriftDefinition(org.rhq.core.domain.auth.Subject subject,
                                                             int driftDefId)
Get the specified drift definition. Note, the full Configuration is fetched.

Parameters:
driftDefId -
Returns:
The drift definition
Throws:
RuntimeException, - IllegalArgumentException if entity or driftDef not found.

getDriftDetails

org.rhq.core.domain.drift.DriftDetails getDriftDetails(org.rhq.core.domain.auth.Subject subject,
                                                       String driftId)
Returns an object that encapsulates the information needed for viewing drift details

Parameters:
subject -
driftId -
Returns:

getDriftFile

org.rhq.core.domain.drift.DriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject,
                                                 String hashId)
                                                 throws Exception
Throws:
Exception

getDriftFileBits

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

Specified by:
getDriftFileBits in interface DriftManagerRemote
Parameters:
hash - The hash the uniquely identifies the requested content
Returns:
The content as a string

isBinaryFile

boolean isBinaryFile(org.rhq.core.domain.auth.Subject subject,
                     org.rhq.core.domain.drift.Drift<?,?> drift)

persistSnapshot

String persistSnapshot(org.rhq.core.domain.auth.Subject subject,
                       org.rhq.core.domain.drift.DriftSnapshot snapshot,
                       org.rhq.core.domain.drift.DriftChangeSet<? extends org.rhq.core.domain.drift.Drift<?,?>> changeSet)

processRepeatChangeSet

void processRepeatChangeSet(int resourceId,
                            String driftDefName,
                            int version)

purgeByDriftDefinitionName

void purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject,
                                int resourceId,
                                String driftDefName)
                                throws Exception
When a user wants to completely remove all data related to a drift definition, this method will be called to give the plugin a chance to clean up any data related to the drift definition that is going to be deleted.

Parameters:
Subject -
resourceId - the resource whose drift definition is being purged
driftDefName - identifies the data that is to be purged
Throws:
Exception

saveChangeSetContent

void saveChangeSetContent(org.rhq.core.domain.auth.Subject subject,
                          int resourceId,
                          String driftDefName,
                          String token,
                          File changeSetFilesZip)
                          throws Exception
Throws:
Exception

saveChangeSet

DriftChangeSetSummary saveChangeSet(org.rhq.core.domain.auth.Subject subject,
                                    int resourceId,
                                    File changeSetZip)
                                    throws Exception
Throws:
Exception

saveChangeSetFiles

void saveChangeSetFiles(org.rhq.core.domain.auth.Subject subject,
                        File changeSetFilesZip)
                        throws Exception
Throws:
Exception

updateDriftDefinition

void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject,
                           org.rhq.core.domain.drift.DriftDefinition driftDefinition)

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:

Specified by:
updateDriftDefinition in interface DriftManagerRemote
Parameters:
subject -
entityContext -
driftDef -

purgeOrphanedDriftFiles

int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject,
                            long purgeMillis)
This will remove all drift files that are no longer referenced by drift entries. This is a maintenance method to help reclaim space on the backend.

Parameters:
subject -
purgeMillis - only those unused drift files that are older than this (in epoch millis) will be purged.
Returns:
number of orphaned drife files that were removed


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