org.rhq.core.pc.drift.sync
Interface DriftSynchronizer


public interface DriftSynchronizer

A DriftSynchronizer is responsible for sycning DriftDefinitions in the server's with those in the local inventory.


Method Summary
 void addToLocalInventory(int resourceId, List<org.rhq.core.domain.drift.DriftDefinition> definitions)
          Adds the drift definitions to the local inventory.
 List<org.rhq.core.domain.drift.DriftDefinition> getAddedDefinitions(int resourceId, Set<org.rhq.core.domain.drift.DriftDefinition> definitionsFromServer)
          Determines which drift definitions for a resource have been added on the server and need to be added to the local inventory.
 List<org.rhq.core.domain.drift.DriftDefinition> getDeletedDefinitions(int resourceId, Set<org.rhq.core.domain.drift.DriftDefinition> definitionsFromServer)
          Determines which drift definitions for a resource have been deleted on the server and need to be purged from the local inventory.
 void purgeFromLocalInventory(int resourceId, List<org.rhq.core.domain.drift.DriftDefinition> definitions)
          Removes the drift definitions from local inventory.
 void syncChangeSetContent()
          This is an optional operation as it can only be performed when DriftManager is fully initialized.
 

Method Detail

getDeletedDefinitions

List<org.rhq.core.domain.drift.DriftDefinition> getDeletedDefinitions(int resourceId,
                                                                      Set<org.rhq.core.domain.drift.DriftDefinition> definitionsFromServer)
Determines which drift definitions for a resource have been deleted on the server and need to be purged from the local inventory. This method should not make any changes to the local inventory. It also handles syncing content with the server. Any change set content found on the agent and that is not known to be on the server should be sent to the server.

Parameters:
resourceId -
definitionsFromServer - A set of drift definitions belonging to the resource with the specified id. The set uses a driftDefinitionComparator with the compare mode set to BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS.
Returns:
A list of drift definitions that need to be purged from the local inventory.

purgeFromLocalInventory

void purgeFromLocalInventory(int resourceId,
                             List<org.rhq.core.domain.drift.DriftDefinition> definitions)
Removes the drift definitions from local inventory. Implementations are responsible for deciding how that is to be done. For example, if the plugin container is not fully initialized, then purging will involve removing definitions from the ResourceContainer. But if the plugin container is initialized, then drift detection will have to be unscheduled.

Parameters:
resourceId -
definitions - The drift definitions to purge from local inventory

getAddedDefinitions

List<org.rhq.core.domain.drift.DriftDefinition> getAddedDefinitions(int resourceId,
                                                                    Set<org.rhq.core.domain.drift.DriftDefinition> definitionsFromServer)
Determines which drift definitions for a resource have been added on the server and need to be added to the local inventory. This method should not make any changes to the local inventory.

Parameters:
resourceId -
definitionsFromServer - A set of drift definitions belonging to the resource with the specified id. The set uses a driftDefinitionComparator with the compare mode set to BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS.
Returns:
A list of drift definitions that need to be purged from the local inventory.

addToLocalInventory

void addToLocalInventory(int resourceId,
                         List<org.rhq.core.domain.drift.DriftDefinition> definitions)
Adds the drift definitions to the local inventory. Implementations are responsible for deciding how that is to be done. For example, if the plugin container is not fully initialized, then adding a definition will involve adding it to the ResourceContainer. But if the plugin container is initialized, drift detection will have to be scheduled.

Parameters:
resourceId -
definitions - The drift definitions to add to the local inventory.

syncChangeSetContent

void syncChangeSetContent()
This is an optional operation as it can only be performed when DriftManager is fully initialized. Implementations are responsible for detecting any change set content that may not be on the server and then sending that content to the server.



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