org.rhq.enterprise.server.sync
Interface SynchronizationManagerLocal

All Known Implementing Classes:
SynchronizationManagerBean

public interface SynchronizationManagerLocal

Author:
Lukas Krejci

Method Summary
 org.rhq.core.domain.sync.ExportReport exportAllSubsystems(org.rhq.core.domain.auth.Subject subject)
          Don't use this method if you access it from the same JVM.
 org.rhq.core.domain.sync.ExportWrapper exportAllSubsystemsLocally(org.rhq.core.domain.auth.Subject subject)
          This method returns an export wrapper that contains the structure to contain the future messages from the export process and an input stream that is going to create the export (and fill in the messages) while it is being read.
 org.rhq.core.domain.sync.ImportConfigurationDefinition getImportConfigurationDefinition(String synchronizerClass)
           
 List<org.rhq.core.domain.sync.ImportConfigurationDefinition> getImportConfigurationDefinitionOfAllSynchronizers()
           
 org.rhq.core.domain.sync.ImportReport importAllSubsystems(org.rhq.core.domain.auth.Subject subject, byte[] exportFile, List<org.rhq.core.domain.sync.ImportConfiguration> importerConfigurations)
           
 org.rhq.core.domain.sync.ImportReport importAllSubsystems(org.rhq.core.domain.auth.Subject subject, InputStream exportFile, List<org.rhq.core.domain.sync.ImportConfiguration> importerConfigurations)
           
 void setSynchronizerFactory(SynchronizerFactory factory)
          Provided for testability reasons.
 void validate(org.rhq.core.domain.auth.Subject subject, byte[] exportFile)
           
 void validate(org.rhq.core.domain.auth.Subject subject, InputStream exportFile)
           
 

Method Detail

exportAllSubsystemsLocally

org.rhq.core.domain.sync.ExportWrapper exportAllSubsystemsLocally(org.rhq.core.domain.auth.Subject subject)
This method returns an export wrapper that contains the structure to contain the future messages from the export process and an input stream that is going to create the export (and fill in the messages) while it is being read.

This minimizes the memory needed to hold the export data to just 64K (the size of the buffer to hold the data). The memory consumption will of course be also determined by the amount of data being read from the database but the point is that not all the data will be held in memory (because the exporters for various subsystems will be called in sequence) and that the data doesn't have to reside in the memory in two forms - the internal datastructures AND the serialized form of the export file that it is going to be transfered as.

Parameters:
subject - the logged in user that has Permission.MANAGE_INVENTORY permission
Returns:
a wrapper using which one can read the export file "lazily".

validate

void validate(org.rhq.core.domain.auth.Subject subject,
              InputStream exportFile)
              throws ValidationException
Throws:
ValidationException

importAllSubsystems

org.rhq.core.domain.sync.ImportReport importAllSubsystems(org.rhq.core.domain.auth.Subject subject,
                                                          InputStream exportFile,
                                                          List<org.rhq.core.domain.sync.ImportConfiguration> importerConfigurations)
                                                          throws ValidationException,
                                                                 ImportException
Throws:
ValidationException
ImportException

setSynchronizerFactory

void setSynchronizerFactory(SynchronizerFactory factory)
Provided for testability reasons. DON'T USE OUTSIDE TESTS.

Using this method one can provide a custom factory for Synchronizers. This way one can export/import different types of entities than by default.

Parameters:
factory -

exportAllSubsystems

org.rhq.core.domain.sync.ExportReport exportAllSubsystems(org.rhq.core.domain.auth.Subject subject)
Don't use this method if you access it from the same JVM. The #exportAllSubsystemsLocally() is more memory efficient.

This method executes the export of all subsystems and serializes the data into an byte array.

See Also:
SynchronizationManagerRemote#exportAllSubsystems()

validate

void validate(org.rhq.core.domain.auth.Subject subject,
              byte[] exportFile)
              throws ValidationException
Throws:
ValidationException
See Also:
SynchronizationManagerRemote.validate(Subject, byte[])

getImportConfigurationDefinition

org.rhq.core.domain.sync.ImportConfigurationDefinition getImportConfigurationDefinition(String synchronizerClass)
See Also:
SynchronizationManagerRemote.getImportConfigurationDefinition(String)

getImportConfigurationDefinitionOfAllSynchronizers

List<org.rhq.core.domain.sync.ImportConfigurationDefinition> getImportConfigurationDefinitionOfAllSynchronizers()
See Also:
SynchronizationManagerRemote.getImportConfigurationDefinitionOfAllSynchronizers()

importAllSubsystems

org.rhq.core.domain.sync.ImportReport importAllSubsystems(org.rhq.core.domain.auth.Subject subject,
                                                          byte[] exportFile,
                                                          List<org.rhq.core.domain.sync.ImportConfiguration> importerConfigurations)
                                                          throws ValidationException,
                                                                 ImportException
Throws:
ValidationException
ImportException
See Also:
SynchronizationManagerRemote#importAllSubsystems(Subject, byte[], Set)


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