|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.drift.DriftManagerBean
public class DriftManagerBean
The SLSB supporting Drift management to clients. Wrappers are provided for the methods defined in DriftServerPluginFacet and the work is deferred to the plugin No assumption is made about the any back end implementation of a drift server plugin and therefore does not declare any transactioning (the NOT_SUPPORTED transaction attribute is used for all wrappers). For methods not deferred to the server plugin, the implementations are done here.
| Constructor Summary | |
|---|---|
DriftManagerBean()
|
|
| 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 |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DriftManagerBean()
| Method Detail |
|---|
public void addChangeSet(org.rhq.core.domain.auth.Subject subject,
int resourceId,
long zipSize,
InputStream zipStream)
throws Exception
DriftManagerLocal
addChangeSet 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 stream
Exception
public void addFiles(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName,
String token,
long zipSize,
InputStream zipStream)
throws Exception
DriftManagerLocal
addFiles 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 stream
Exception
public void saveChangeSetContent(org.rhq.core.domain.auth.Subject subject,
int resourceId,
String driftDefName,
String token,
File changeSetFilesZip)
throws Exception
saveChangeSetContent in interface DriftManagerLocalException
public void processRepeatChangeSet(int resourceId,
String driftDefName,
int version)
processRepeatChangeSet in interface DriftManagerLocal
public org.rhq.core.domain.drift.DriftSnapshot getSnapshot(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.DriftSnapshotRequest request)
DriftManagerRemote
getSnapshot in interface DriftManagerRemote
public void detectDrift(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
org.rhq.core.domain.drift.DriftDefinition driftDef)
DriftManagerLocal
detectDrift in interface DriftManagerLocal
public void deleteDriftDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext entityContext,
String driftDefName)
DriftManagerRemote
deleteDriftDefinition in interface DriftManagerRemote
public void deleteResourceDriftDefinition(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int driftDefId)
DriftManagerLocal
deleteResourceDriftDefinition in interface DriftManagerLocal
public 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)
DriftManagerRemote
findDriftChangeSetsByCriteria in interface DriftManagerRemote
public 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 DriftManagerLocal
public 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 DriftManagerRemote
public 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 DriftManagerLocal
public 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)
DriftManagerRemote
findDriftsByCriteria in interface DriftManagerRemote
public org.rhq.core.domain.drift.DriftDefinition getDriftDefinition(org.rhq.core.domain.auth.Subject subject,
int driftDefId)
DriftManagerLocal
getDriftDefinition in interface DriftManagerLocal
public org.rhq.core.domain.drift.DriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject,
String hashId)
throws Exception
getDriftFile in interface DriftManagerLocalException
public DriftChangeSetSummary saveChangeSet(org.rhq.core.domain.auth.Subject subject,
int resourceId,
File changeSetZip)
throws Exception
saveChangeSet in interface DriftManagerLocalException
public void saveChangeSetFiles(org.rhq.core.domain.auth.Subject subject,
File changeSetFilesZip)
throws Exception
saveChangeSetFiles in interface DriftManagerLocalException
public 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 purged
Exception
public int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject,
long purgeMillis)
DriftManagerLocal
purgeOrphanedDriftFiles 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 DriftManagerRemote
public 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 DriftManagerLocal
public String getDriftFileBits(org.rhq.core.domain.auth.Subject subject,
String hash)
DriftManagerLocal
getDriftFileBits in interface DriftManagerLocalgetDriftFileBits in interface DriftManagerRemotehash - The hash the uniquely identifies the requested content
public byte[] getDriftFileAsByteArray(org.rhq.core.domain.auth.Subject subject,
String hash)
getDriftFileAsByteArray in interface DriftManagerRemote
public org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiff(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.Drift<?,?> drift)
DriftManagerRemote
generateUnifiedDiff in interface DriftManagerRemotedrift - Specifies the two files that will be compared
public org.rhq.core.domain.drift.FileDiffReport generateUnifiedDiffByIds(org.rhq.core.domain.auth.Subject subject,
String driftId1,
String driftId2)
DriftManagerRemote
generateUnifiedDiffByIds in interface DriftManagerRemote
public 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 compared
public void updateDriftDefinition(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.drift.DriftDefinition driftDefinition)
updateDriftDefinition in interface DriftManagerLocal
public 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 DriftManagerLocal
public org.rhq.core.domain.drift.DriftDetails getDriftDetails(org.rhq.core.domain.auth.Subject subject,
String driftId)
DriftManagerLocal
getDriftDetails in interface DriftManagerLocal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||