public class DriftManagerBean extends Object implements DriftManagerLocal, DriftManagerRemote
| Constructor and Description |
|---|
DriftManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
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 |
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.
|
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<? 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.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.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.
|
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) |
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.
|
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 |
pinSnapshot(org.rhq.core.domain.auth.Subject subject,
int driftDefId,
int snapshotVersion) |
void |
processRepeatChangeSet(int resourceId,
String driftDefName,
int version) |
void |
purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName)
This purges the persisted data related to drift definition, but it does NOT talk to the agent to tell the agent
about this nor does it actually delete the drift def itself.
|
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.
|
static void |
validateDriftDefinition(org.rhq.core.domain.drift.DriftDefinition driftDef) |
public void addChangeSet(org.rhq.core.domain.auth.Subject subject,
int resourceId,
long zipSize,
InputStream zipStream)
throws Exception
DriftManagerLocaladdChangeSet in interface DriftManagerLocalresourceId - 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 streamExceptionpublic void addFiles(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName,
String token,
long zipSize,
InputStream zipStream)
throws Exception
DriftManagerLocaladdFiles in interface DriftManagerLocalresourceId - 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 streamExceptionpublic void saveChangeSetContent(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName,
String token,
File changeSetFilesZip)
throws Exception
saveChangeSetContent in interface DriftManagerLocalExceptionpublic void processRepeatChangeSet(int resourceId,
String driftDefName,
int version)
processRepeatChangeSet in interface DriftManagerLocalpublic org.rhq.core.domain.drift.DriftSnapshot getSnapshot(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.DriftSnapshotRequest request)
DriftManagerRemotegetSnapshot in interface DriftManagerRemotepublic void detectDrift(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
org.rhq.core.domain.drift.DriftDefinition driftDef)
DriftManagerLocaldetectDrift in interface DriftManagerLocalpublic void deleteDriftDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext entityContext,
String driftDefName)
DriftManagerRemotedeleteDriftDefinition in interface DriftManagerRemotepublic void deleteResourceDriftDefinition(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int driftDefId)
DriftManagerLocaldeleteResourceDriftDefinition in interface DriftManagerLocalpublic 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)
DriftManagerRemotefindDriftChangeSetsByCriteria in interface DriftManagerRemotepublic 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)
findDriftCompositesByCriteria in interface DriftManagerLocalpublic 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)
findDriftDefinitionsByCriteria in interface DriftManagerRemotepublic 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)
findDriftDefinitionCompositesByCriteria in interface DriftManagerLocalpublic 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)
DriftManagerRemotefindDriftsByCriteria in interface DriftManagerRemotepublic org.rhq.core.domain.drift.DriftDefinition getDriftDefinition(org.rhq.core.domain.auth.Subject subject,
int driftDefId)
DriftManagerLocalgetDriftDefinition in interface DriftManagerLocalpublic org.rhq.core.domain.drift.DriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject,
String hashId)
throws Exception
getDriftFile in interface DriftManagerLocalExceptionpublic DriftChangeSetSummary saveChangeSet(org.rhq.core.domain.auth.Subject subject, int resourceId, File changeSetZip) throws Exception
saveChangeSet in interface DriftManagerLocalExceptionpublic void saveChangeSetFiles(org.rhq.core.domain.auth.Subject subject,
File changeSetFilesZip)
throws Exception
saveChangeSetFiles in interface DriftManagerLocalExceptionpublic void purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName)
throws Exception
deleteDriftDefinition(Subject, EntityContext, String) instead.
This method is really for internal use only.purgeByDriftDefinitionName in interface DriftManagerLocalresourceId - the resource whose drift definition is being purgeddriftDefName - identifies the data that is to be purgedExceptionpublic int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject,
long purgeMillis)
DriftManagerLocalpurgeOrphanedDriftFiles in interface DriftManagerLocalpurgeMillis - only those unused drift files that are older than this (in epoch millis) will be purged.public void pinSnapshot(org.rhq.core.domain.auth.Subject subject,
int driftDefId,
int snapshotVersion)
pinSnapshot in interface DriftManagerRemotepublic 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)
persistSnapshot in interface DriftManagerLocalpublic String getDriftFileBits(org.rhq.core.domain.auth.Subject subject, String hash)
DriftManagerLocalgetDriftFileBits in interface DriftManagerLocalgetDriftFileBits in interface DriftManagerRemotehash - The hash the uniquely identifies the requested contentpublic byte[] getDriftFileAsByteArray(org.rhq.core.domain.auth.Subject subject,
String hash)
getDriftFileAsByteArray in interface DriftManagerRemotepublic org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.Drift<?,?> drift)
DriftManagerRemotegenerateUnifiedDiff in interface DriftManagerRemotedrift - Specifies the two files that will be comparedpublic org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiffByIds(org.rhq.core.domain.auth.Subject subject,
String driftId1,
String driftId2)
DriftManagerRemotegenerateUnifiedDiffByIds in interface DriftManagerRemotepublic 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)
DriftManagerRemoteDrift.getNewDriftFile()
are compared.generateUnifiedDiff in interface DriftManagerRemotedrift1 - References the first file to be compareddrift2 - References the second file to be comparedpublic void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.DriftDefinition driftDefinition)
updateDriftDefinition in interface DriftManagerLocalpublic void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext entityContext,
org.rhq.core.domain.drift.DriftDefinition driftDef)
DriftManagerLocalSaves 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:
updateDriftDefinition in interface DriftManagerLocalupdateDriftDefinition in interface DriftManagerRemotepublic static void validateDriftDefinition(org.rhq.core.domain.drift.DriftDefinition driftDef)
public boolean isBinaryFile(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.Drift<?,?> drift)
isBinaryFile in interface DriftManagerLocalpublic org.rhq.core.domain.drift.DriftDetails getDriftDetails(org.rhq.core.domain.auth.Subject subject,
String driftId)
DriftManagerLocalgetDriftDetails in interface DriftManagerLocalCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.