org.rhq.enterprise.server.drift
Interface JPADriftServerLocal

All Known Implementing Classes:
JPADriftServerBean

public interface JPADriftServerLocal

The SLSB methods needed to support the JPA (RHQ Default) Drift Server Plugin.

Author:
Jay Shaughnessy, John Sanda

Method Summary
 void ackChangeSetInNewTransaction(org.rhq.core.domain.auth.Subject subject, int resourceId, Headers headers, List<org.rhq.core.domain.drift.JPADriftFile> driftFilesToRequest)
          For transactioning purposes only, part of storeChangeSet impl.
 String copyChangeSet(org.rhq.core.domain.auth.Subject subject, String changeSetId, int driftDefId, int resourceId)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.JPADriftChangeSet> 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.JPADrift> 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.JPADriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject, String sha256)
          Simple get method for a JPADriftFile.
 byte[] getDriftFileAsByteArray(String hash)
           
 String getDriftFileBits(String hash)
           
 String persistChangeSet(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.drift.DriftChangeSet<?> changeSet)
           
 org.rhq.core.domain.drift.JPADriftFile persistDriftFile(org.rhq.core.domain.drift.JPADriftFile driftFile)
          SUPPORTS JPA DRIFT SERVER PLUGIN
 void persistDriftFileData(org.rhq.core.domain.drift.JPADriftFile driftFile, InputStream data, long numBytes)
          SUPPORTS JPA DRIFT SERVER PLUGIN
 void purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject, int resourceId, String driftDefName)
          SUPPORTS JPA DRIFT SERVER PLUGIN This is for internal use only - do not call it unless you know what you are doing.
 int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject, long purgeMillis)
          SUPPORTS JPA DRIFT SERVER PLUGIN This will remove all drift files that are no longer referenced by drift entries.
 DriftChangeSetSummary storeChangeSet(org.rhq.core.domain.auth.Subject subject, int resourceId, File changeSetZip)
          This method stores the provided change-set file for the resource.
 DriftChangeSetSummary storeChangeSetInNewTransaction(org.rhq.core.domain.auth.Subject subject, int resourceId, File changeSetZip, List<org.rhq.core.domain.drift.JPADriftFile> driftFilesToRequest, Headers[] headers)
          For transactioning purposes only, part of storeChangeSet impl.
 void storeFiles(org.rhq.core.domain.auth.Subject subject, File filesZip)
          This method stores the provided drift files.
 

Method Detail

getDriftFile

org.rhq.core.domain.drift.JPADriftFile getDriftFile(org.rhq.core.domain.auth.Subject subject,
                                                    String sha256)
Simple get method for a JPADriftFile. Does not return the content.

Parameters:
subject -
sha256 -
Returns:
The JPADriftFile sans content.

findDriftChangeSetsByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.JPADriftChangeSet> findDriftChangeSetsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                             org.rhq.core.domain.criteria.DriftChangeSetCriteria criteria)
Standard criteria based fetch method

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

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)

findDriftsByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.drift.JPADrift> findDriftsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                           org.rhq.core.domain.criteria.DriftCriteria criteria)
Standard criteria based fetch method

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

persistChangeSet

String persistChangeSet(org.rhq.core.domain.auth.Subject subject,
                        org.rhq.core.domain.drift.DriftChangeSet<?> changeSet)

copyChangeSet

String copyChangeSet(org.rhq.core.domain.auth.Subject subject,
                     String changeSetId,
                     int driftDefId,
                     int resourceId)

persistDriftFile

org.rhq.core.domain.drift.JPADriftFile persistDriftFile(org.rhq.core.domain.drift.JPADriftFile driftFile)
                                                        throws Exception
SUPPORTS JPA DRIFT SERVER PLUGIN

Parameters:
driftFile -
Returns:
Throws:
Exception

persistDriftFileData

void persistDriftFileData(org.rhq.core.domain.drift.JPADriftFile driftFile,
                          InputStream data,
                          long numBytes)
                          throws Exception
SUPPORTS JPA DRIFT SERVER PLUGIN

Parameters:
driftFile -
data -
Throws:
Exception

storeChangeSet

DriftChangeSetSummary storeChangeSet(org.rhq.core.domain.auth.Subject subject,
                                     int resourceId,
                                     File changeSetZip)
                                     throws Exception
This method stores the provided change-set file for the resource. The version will be incremented based on the max version of existing change-sets for the resource. The change-set will be processed generating requests for drift file content and/or drift instances as required.

Parameters:
resourceId - The resource for which the change-set is being reported.
changeSetZip - The change-set zip file
Returns:
a summary of the change set that was persisted
Throws:
Exception

storeChangeSetInNewTransaction

DriftChangeSetSummary storeChangeSetInNewTransaction(org.rhq.core.domain.auth.Subject subject,
                                                     int resourceId,
                                                     File changeSetZip,
                                                     List<org.rhq.core.domain.drift.JPADriftFile> driftFilesToRequest,
                                                     Headers[] headers)
                                                     throws Exception
For transactioning purposes only, part of storeChangeSet impl. Not to be exposed outside of local interface.

Throws:
Exception

ackChangeSetInNewTransaction

void ackChangeSetInNewTransaction(org.rhq.core.domain.auth.Subject subject,
                                  int resourceId,
                                  Headers headers,
                                  List<org.rhq.core.domain.drift.JPADriftFile> driftFilesToRequest)
                                  throws Exception
For transactioning purposes only, part of storeChangeSet impl. Not to be exposed outside of local interface.

Throws:
Exception

storeFiles

void storeFiles(org.rhq.core.domain.auth.Subject subject,
                File filesZip)
                throws Exception
This method stores the provided drift files. The files should correspond to requested drift files. The unzipped files will have their sha256 generated. Those not corresponding to needed content will be logged and ignored.

Parameters:
filesZip - The change-set zip file
Throws:
Exception

purgeByDriftDefinitionName

void purgeByDriftDefinitionName(org.rhq.core.domain.auth.Subject subject,
                                int resourceId,
                                String driftDefName)
                                throws Exception
SUPPORTS JPA DRIFT SERVER PLUGIN This is for internal use only - do not call it unless you know what you are doing. This purges all drift entities and changeset entities associated with the drift definition.

Throws:
Exception

purgeOrphanedDriftFiles

int purgeOrphanedDriftFiles(org.rhq.core.domain.auth.Subject subject,
                            long purgeMillis)
SUPPORTS JPA DRIFT SERVER PLUGIN 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 -
Returns:
number of orphaned drife files that were removed

getDriftFileBits

String getDriftFileBits(String hash)

getDriftFileAsByteArray

byte[] getDriftFileAsByteArray(String hash)


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