it.eng.spagobi.importexport
Class ImporterMetadata

java.lang.Object
  extended by it.eng.spagobi.importexport.ImporterMetadata

public class ImporterMetadata
extends java.lang.Object

Implements methods to gather information from exported database and to make some checks into the current SpagoBI database


Constructor Summary
ImporterMetadata()
           
 
Method Summary
 java.lang.Object checkExistence(java.lang.Object unique, org.hibernate.Session sessionCurrDB, java.lang.Object hibObj)
          Check the existance of an object, based on his unique constraints, into the current SpagoBI database
 java.util.List getAllExportedEngines(org.hibernate.Transaction tx, org.hibernate.Session session)
          Get the list of exported hibernate engine objects
 java.util.List getAllExportedRoles(org.hibernate.Transaction tx, org.hibernate.Session session)
          Get the list of exported hibernate role objects
 java.util.List getAllExportedSbiObjects(org.hibernate.Transaction tx, org.hibernate.Session session, java.lang.String table)
          Get the list of exported hibernate objects
 java.lang.Object getObject(java.lang.Integer id, java.lang.Class objClass, org.hibernate.Transaction tx, org.hibernate.Session session)
          Get an existing object identified by the id and the class
 SbiObjects insertBIObject(SbiObjects obj, java.lang.String pathContent, org.hibernate.Session session)
          Insert a BIObject into the database and cms repository
 void insertObject(java.lang.Object hibObj, org.hibernate.Session session)
          Insert a generic Hibernate object into the exported database
 void updateConnRefs(java.util.Map associations, org.hibernate.Transaction tx, org.hibernate.Session session, MetadataLogger log)
          Upadates the connection name into the query lov objects based on the assocaition defined by the user between exported and current SpagoBI connection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImporterMetadata

public ImporterMetadata()
Method Detail

getAllExportedRoles

public java.util.List getAllExportedRoles(org.hibernate.Transaction tx,
                                          org.hibernate.Session session)
                                   throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate role objects

Parameters:
tx - Hiberante transaction for the exported database
session - Hiberante session for the exported database
Returns:
The list of exported hibernate roles
Throws:
it.eng.spago.error.EMFUserError

getAllExportedEngines

public java.util.List getAllExportedEngines(org.hibernate.Transaction tx,
                                            org.hibernate.Session session)
                                     throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate engine objects

Parameters:
tx - Hibernate transaction for the exported database
session - Hibernate session for the exported database
Returns:
The list of exported hibernate engines
Throws:
it.eng.spago.error.EMFUserError

getAllExportedSbiObjects

public java.util.List getAllExportedSbiObjects(org.hibernate.Transaction tx,
                                               org.hibernate.Session session,
                                               java.lang.String table)
                                        throws it.eng.spago.error.EMFUserError
Get the list of exported hibernate objects

Parameters:
tx - Hibernate transaction for the exported database
session - Hibernate session for the exported database
table - The name of the table corresponding to the hibernate objects to gather
Returns:
The list of exported hibernate objects
Throws:
it.eng.spago.error.EMFUserError

getObject

public java.lang.Object getObject(java.lang.Integer id,
                                  java.lang.Class objClass,
                                  org.hibernate.Transaction tx,
                                  org.hibernate.Session session)
Get an existing object identified by the id and the class

Parameters:
id - The Object id
objClass - The class of the object
tx - Hibernate transaction for a database
session - Hibernate session for a database
Returns:
The existing hibernate object

updateConnRefs

public void updateConnRefs(java.util.Map associations,
                           org.hibernate.Transaction tx,
                           org.hibernate.Session session,
                           MetadataLogger log)
                    throws it.eng.spago.error.EMFUserError
Upadates the connection name into the query lov objects based on the assocaition defined by the user between exported and current SpagoBI connection

Parameters:
associations - Map of associations between exported connections and connections of the current SpagoBI platform
tx - Hibernate transaction for the exported database
session - Hibernate session for the exported database
Throws:
it.eng.spago.error.EMFUserError

insertObject

public void insertObject(java.lang.Object hibObj,
                         org.hibernate.Session session)
                  throws it.eng.spago.error.EMFUserError
Insert a generic Hibernate object into the exported database

Parameters:
hibObj - The object to insert
session - Hibernate session for the exported database
Throws:
it.eng.spago.error.EMFUserError

insertBIObject

public SbiObjects insertBIObject(SbiObjects obj,
                                 java.lang.String pathContent,
                                 org.hibernate.Session session)
                          throws it.eng.spago.error.EMFUserError
Insert a BIObject into the database and cms repository

Parameters:
obj - The Hiberante BIObject to insert
pathContent - The path of the temporary contents directory
session - Hibernate session for the exported database
Returns:
The Hibernate BIObject inserted
Throws:
it.eng.spago.error.EMFUserError

checkExistence

public java.lang.Object checkExistence(java.lang.Object unique,
                                       org.hibernate.Session sessionCurrDB,
                                       java.lang.Object hibObj)
                                throws it.eng.spago.error.EMFUserError
Check the existance of an object, based on his unique constraints, into the current SpagoBI database

Parameters:
unique - The object which contains the unique constraints for the object
sessionCurrDB - Hibernate session for the current SpagoBI database
hibObj - An empty object usefull to identify the kind of object to analize
Returns:
The existing Object or null if it doesn't exist
Throws:
it.eng.spago.error.EMFUserError