it.eng.spagobi.importexport
Class ImportManager

java.lang.Object
  extended by it.eng.spagobi.importexport.ImportManager
All Implemented Interfaces:
IImportManager, java.io.Serializable

public class ImportManager
extends java.lang.Object
implements IImportManager, java.io.Serializable

Implements the interface which defines methods for managing the import requests

See Also:
Serialized Form

Constructor Summary
ImportManager()
           
 
Method Summary
 void checkExistingMetadata()
          Check the existance of the exported metadata into the current system metadata and insert their associations into the association object MeatadataAssociation
 void checkRoleReferences(java.util.Map roleAssociations)
          checks if two or more exported roles are associate to the same current role
 ImportResultInfo commitAllChanges()
          Commits all changes made on exported and current databases
 java.lang.String getCurrentVersion()
          Gets the current SpagobI version
 java.util.List getExportedConnections()
          Gets the list of exported connections
 java.util.List getExportedEngines()
          Gets the list of all exported engines
 java.util.List getExportedRoles()
          Gets the list of all exported roles
 java.lang.String getExportVersion()
          Gets the SpagoBI version of the exported file
 MetadataAssociations getMetadataAssociation()
          Gets the object which contains the association between exported metadata and the current system metadata
 void importObjects()
          Imports the exported objects
 void prepareImport(java.lang.String pathImpTmpFold, java.lang.String archiveName, byte[] archiveContent)
          Prepare the environment for the import procedure
 void stopImport()
          Ends the import procedure
 void updateConnectionReferences(java.util.Map connAssociations)
          Update the connection name for each list of values of type query based on association between exported connections and current system connections
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportManager

public ImportManager()
Method Detail

prepareImport

public void prepareImport(java.lang.String pathImpTmpFold,
                          java.lang.String archiveName,
                          byte[] archiveContent)
                   throws it.eng.spago.error.EMFUserError
Prepare the environment for the import procedure

Specified by:
prepareImport in interface IImportManager
Parameters:
pathImpTmpFold - The path of the temporary import folder
archiveName - the name of the compress exported file
archiveContent - the bytes of the compress exported file
Throws:
it.eng.spago.error.EMFUserError

getExportVersion

public java.lang.String getExportVersion()
Gets the SpagoBI version of the exported file

Specified by:
getExportVersion in interface IImportManager
Returns:
The SpagoBI version of the exported file

getCurrentVersion

public java.lang.String getCurrentVersion()
Gets the current SpagobI version

Specified by:
getCurrentVersion in interface IImportManager
Returns:
The current SpagoBI version

getExportedRoles

public java.util.List getExportedRoles()
                                throws it.eng.spago.error.EMFUserError
Gets the list of all exported roles

Specified by:
getExportedRoles in interface IImportManager
Returns:
The list of exported roles
Throws:
it.eng.spago.error.EMFUserError

getExportedEngines

public java.util.List getExportedEngines()
                                  throws it.eng.spago.error.EMFUserError
Gets the list of all exported engines

Specified by:
getExportedEngines in interface IImportManager
Returns:
The list of exported engines
Throws:
it.eng.spago.error.EMFUserError

checkRoleReferences

public void checkRoleReferences(java.util.Map roleAssociations)
                         throws it.eng.spago.error.EMFUserError
checks if two or more exported roles are associate to the same current role

Parameters:
roleAssociations - Map of assocaition between exported roles and roles of the portal in use
Throws:
it.eng.spago.error.EMFUserError - if two ore more exported roles are associate to the same current role

updateConnectionReferences

public void updateConnectionReferences(java.util.Map connAssociations)
                                throws it.eng.spago.error.EMFUserError
Update the connection name for each list of values of type query based on association between exported connections and current system connections

Parameters:
connAssociations - Map of the associations between exported connections and current system connections
Throws:
it.eng.spago.error.EMFUserError

commitAllChanges

public ImportResultInfo commitAllChanges()
                                  throws it.eng.spago.error.EMFUserError
Commits all changes made on exported and current databases

Specified by:
commitAllChanges in interface IImportManager
Returns:
String, the path of the log file
Throws:
it.eng.spago.error.EMFUserError

importObjects

public void importObjects()
                   throws it.eng.spago.error.EMFUserError
Imports the exported objects

Specified by:
importObjects in interface IImportManager
Throws:
it.eng.spago.error.EMFUserError

stopImport

public void stopImport()
Ends the import procedure

Specified by:
stopImport in interface IImportManager

getExportedConnections

public java.util.List getExportedConnections()
                                      throws it.eng.spago.error.EMFUserError
Gets the list of exported connections

Specified by:
getExportedConnections in interface IImportManager
Returns:
List of the exported connections
Throws:
it.eng.spago.error.EMFUserError

checkExistingMetadata

public void checkExistingMetadata()
                           throws it.eng.spago.error.EMFUserError
Check the existance of the exported metadata into the current system metadata and insert their associations into the association object MeatadataAssociation

Specified by:
checkExistingMetadata in interface IImportManager
Throws:
it.eng.spago.error.EMFUserError

getMetadataAssociation

public MetadataAssociations getMetadataAssociation()
Gets the object which contains the association between exported metadata and the current system metadata

Specified by:
getMetadataAssociation in interface IImportManager
Returns:
MetadataAssociation the object which contains the association between exported metadata and the current system metadata