Skip navigation links


com.thortech.xl.ejb.beansimpl
Class tcImportOperationsBean

java.lang.Object
  extended by Thor.API.Base.tcBaseUtility
      extended by com.thortech.xl.ejb.beansimpl.tcImportOperationsBean

All Implemented Interfaces:
com.thortech.xl.dataobj.tcErrorReceiver, com.thortech.xl.orb.api.operations._tcUtilityIntfOperations, com.thortech.xl.server.tcOrbServerObject, tcUtilityOperationsIntf, tcImportOperationsIntf

public class tcImportOperationsBean
extends tcBaseUtility
implements tcImportOperationsIntf

Server-side API class for Imports using Deployment Manager The APIs will be called in following order:


Nested Class Summary

 

Nested classes/interfaces inherited from class Thor.API.Base.tcBaseUtility
tcBaseUtility.Entities

 

Field Summary

 

Fields inherited from class Thor.API.Base.tcBaseUtility
ALL_ATTR_OB, DATE_FORMAT_SYS_PROP, DEFAULT_DATE_PATTERN, DEFAULT_LOCALE, DISPLAYNAME, FIRSTNAME, LASTNAME, LKU_GROUP, MANAGERKEY, ORG_NAME, ORGANIZATION_KEY_COL_CODE, ORGANIZATION_NAME_COL_CODE, ORGKEY, ORGNAME, ROLE_KEY_COL_CODE, ROLE_NAME_COL_CODE, STATUS, USER_ENTITY, USER_MANAGEMENT, USERID, USERKEY, USR_DEFINED_COLUMN_CONSTANT, USR_KEY_COL_CODE, USR_MANAGER_FIRST_NAME_COL_CODE, USR_MANAGER_FIRST_NAME_COLUMN, USR_MANAGER_KEY_COL_CODE, USR_MANAGER_LAST_NAME_COL_CODE, USR_MANAGER_LAST_NAME_COLUMN, USR_MANAGER_LOGIN_COL_CODE, USR_MANAGER_LOGIN_COLUMN

 

Constructor Summary
tcImportOperationsBean()
           

 

Method Summary
 void acquireLock(boolean forcedAcquisition)
          Try to acquire the lock
 java.util.Collection addConnectorPreviewedFile(java.util.Collection col)
          All the RootObjects which are being calculated for deletion are to be populated.
 java.util.Collection addLastPreviewedFile()
          Add the file previewed before into the files to be imported.
 void addSubstitution(RootObject robj, java.lang.String name)
          Create a substitutions for a given root object.
 java.util.Collection addXMLFile(java.lang.String filename, java.lang.String content)
          Add a new XML File to import some more objects in the current session.
 java.lang.String checkTasks(TaskObject pt)
          It checks the dependency tasks to be available if a task is being imported/deleted.
 void close()
          This method will clean up all resources associated with this object.
 void ejbActivate()
          Throw an exception and don't activate
 void ejbCreate()
          create a session bean and try to acquire the lock.
 void ejbPassivate()
          Passivate the ebjb
 void ejbRemove()
          Remove the EJB and release the lock
 RootObject findITResourceType(RootObject obj)
           
 java.util.Collection findITResourceTypeParams(RootObject obj)
           
 java.util.Collection getConnectorRootObjects(java.lang.String type)
          Returns a collection of RootObjects which are present in the connector XML file to be imported of a particular entity type.
 LockOwner getCurrentLockInfo()
          Return information about the current owner of the lock
 java.util.Collection getFileList()
          Retrieve list of files currently added for import
 FilePreview getFilePreview(java.lang.String filename, java.lang.String content)
          Get the preview of a file.
 java.util.HashMap getImportMessages(java.util.Collection col)
          Get the import plan of selected objects.
 ImportView getImportView(java.util.Collection col)
          Get the import view.
 java.util.Collection getMissingDependencies(java.util.Collection selection, java.lang.String type)
          Return list of missing dependencies.
 java.util.Collection getProcessTasks(java.util.Collection col)
          Returns Collection of TaskObjects containing details of all the process tasks to be taken care of during import
 java.util.Collection getSourceTree(RootObject root)
          Return the object as it appeared in the source database.
 java.util.HashMap getSubstitutions()
          get the current substitutions
 boolean isLockAcquired()
          Check to see if we have the lock
 java.util.Collection listPossibleSubstitutions(java.util.Collection col)
          Return a list of root objects that allow substitions, and are dependencies to the objects passed as collection.
 void performImport(java.util.Collection col)
          Perform the actual import operation on the selected objects.
 void populateChildren(java.util.Collection oldObjects)
          Populates the name value pairs to be saved to export this dependency.
 java.util.Collection removeFiles(java.util.Collection filenames)
          Removes the selected XML Files and recomputes what is going to happen.
 void removeSubstitution(RootObject robj)
          Remove substitutions for a given root object
 java.util.Collection retrieveChildren(java.util.Collection objects)
          Returns collection of RootObjects whose children need to be populated.
 void updateTasks(TaskObject pt)
          The TaskObject contain the details of a process Task which needs to be updated to check if it needs to be deleted/Imported

 

Methods inherited from class Thor.API.Base.tcBaseUtility
addError, addErrorReceiver, addReject, checkStatusAndCallbackProvisioningHandler, clearErrors, getDataBase, getDefaultLocaleCode, getEJBContext, getErrors, getMap, getMapping, getName, getQueryFilter, getRejections, getSessionContext, getUnAuthorizedTargetFieldSet, removeErrorReceiver, removeInstance, setCountry, setLanguage, setSessionContext, setVariant

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface Thor.API.Base.tcUtilityOperationsIntf
getName, setCountry, setLanguage, setVariant

 

Constructor Detail

tcImportOperationsBean

public tcImportOperationsBean()

Method Detail

ejbCreate

public void ejbCreate()
               throws DDMException,
                      CreateException,
                      java.sql.SQLException,
                      javax.naming.NamingException
create a session bean and try to acquire the lock.
Throws:
UnableToAcquireLock - if some other import is in progress
DDMException - General Deployment Manager errors
java.sql.SQLException - General database errors
javax.naming.NamingException - When the database cannot be lookedup
CreateException

close

public void close()
This method will clean up all resources associated with this object. Called when it will no longer be used.
Specified by:
close in interface tcUtilityOperationsIntf
Overrides:
close in class tcBaseUtility

ejbRemove

public void ejbRemove()
               throws EJBException,
                      java.rmi.RemoteException
Remove the EJB and release the lock
Overrides:
ejbRemove in class tcBaseUtility
Throws:
EJBException - Thrown if the instance could not perform the function requested by the container because of an system-level error.
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws EJBException,
                         java.rmi.RemoteException
Passivate the ebjb
Overrides:
ejbPassivate in class tcBaseUtility
Throws:
EJBException - Thrown if the instance could not perform the function requested by the container because of an system-level error.
java.rmi.RemoteException

ejbActivate

public void ejbActivate()
                 throws EJBException,
                        java.rmi.RemoteException
Throw an exception and don't activate
Overrides:
ejbActivate in class tcBaseUtility
Throws:
EJBException - Thrown if the instance could not perform the function requested by the container because of an system-level error.
java.rmi.RemoteException

isLockAcquired

public boolean isLockAcquired()
Check to see if we have the lock
Specified by:
isLockAcquired in interface tcImportOperationsIntf
Returns:
Did the current bean have the lock

getCurrentLockInfo

public LockOwner getCurrentLockInfo()
Return information about the current owner of the lock
Specified by:
getCurrentLockInfo in interface tcImportOperationsIntf
Returns:

acquireLock

public void acquireLock(boolean forcedAcquisition)
                 throws java.sql.SQLException,
                        javax.naming.NamingException,
                        DDMException
Try to acquire the lock
Specified by:
acquireLock in interface tcImportOperationsIntf
Parameters:
forcedAcquisition - True, if lock must be acquired regardless of another import in progress
Throws:
java.sql.SQLException
javax.naming.NamingException
UnableToAcquireLock
SQLException
NamingException
DDMException

addXMLFile

public java.util.Collection addXMLFile(java.lang.String filename,
                                       java.lang.String content)
                                throws DDMException,
                                       TransformationException
Add a new XML File to import some more objects in the current session.
Specified by:
addXMLFile in interface tcImportOperationsIntf
Parameters:
filename - Filename of the file being imported. For tracking purposes.
content - Content of the file to be imported.
Throws:
DDMException - Generic deployment manager error
java.sql.SQLException - Generic database error
TransformationException - Input file version is different from the current version and transformation of the data to current version failed.
com.thortech.xl.ddm.exception.DuplicateObjectException - Same object is also being imported from a different file.

removeFiles

public java.util.Collection removeFiles(java.util.Collection filenames)
                                 throws DDMException,
                                        TransformationException
Removes the selected XML Files and recomputes what is going to happen. Very expensive call in terms of computation.
Specified by:
removeFiles in interface tcImportOperationsIntf
Parameters:
filenames - Files to be removed
Returns:
List of objects found in the remaining files as a flat list
Throws:
DDMException - Generic Deployment error during merging
java.sql.SQLException - Generic database error during merging
TransformationException - Input versions cannot be transformed to current version

getFilePreview

public FilePreview getFilePreview(java.lang.String filename,
                                  java.lang.String content)
                           throws DDMException,
                                  TransformationException
Get the preview of a file. File name, who exported it, source database etc
Specified by:
getFilePreview in interface tcImportOperationsIntf
Returns:
Throws:
DDMException
TransformationException - Transformation of the file failed
com.thortech.xl.ddm.exception.DuplicateObjectException - When the file being added conflicts with another objects
DDMException - Generic deployment manager exception

getFileList

public java.util.Collection getFileList()
                                 throws DDMException
Retrieve list of files currently added for import
Specified by:
getFileList in interface tcImportOperationsIntf
Returns:
Return list of files being imported. Contains the FilePreview objects.
Throws:
DDMException

addLastPreviewedFile

public java.util.Collection addLastPreviewedFile()
                                          throws DDMException
Add the file previewed before into the files to be imported.
Specified by:
addLastPreviewedFile in interface tcImportOperationsIntf
Returns:
List of objects found in the file just added
Throws:
DDMException
DDMException

getSourceTree

public java.util.Collection getSourceTree(RootObject root)
                                   throws DDMException
Return the object as it appeared in the source database. This includes all the parents and all the childs of the selected object
Parameters:
root - Object for which source tree is needed
Returns:
Tree containing all the objects in the source tree
Throws:
DDMException

getImportMessages

public java.util.HashMap getImportMessages(java.util.Collection col)
                                    throws DDMException
Get the import plan of selected objects. This will give any warnings, errors and other information For example: what is going to happen, any missing dependencies etc. Map contains the RootObject as the key and the a collection of ImportMessage as value.
Specified by:
getImportMessages in interface tcImportOperationsIntf
Parameters:
col -
Returns:
Return import plan
Throws:
DDMException
DDMException

getImportView

public ImportView getImportView(java.util.Collection col)
                         throws DDMException
Get the import view. This is to be used by the webclient to get the information to be displayed.
Specified by:
getImportView in interface tcImportOperationsIntf
Parameters:
Col - (Collection of root objects)
Returns:
Throws:
DDMException
DDMException

listPossibleSubstitutions

public java.util.Collection listPossibleSubstitutions(java.util.Collection col)
                                               throws DDMException
Return a list of root objects that allow substitions, and are dependencies to the objects passed as collection. This is primarily used by webclient.
Specified by:
listPossibleSubstitutions in interface tcImportOperationsIntf
Parameters:
col - collection of objects for which substitutions can be made
Returns:
substitutable dependencies
Throws:
DDMException - Deployment Error

findITResourceType

public RootObject findITResourceType(RootObject obj)
                              throws java.sql.SQLException,
                                     DDMException
Specified by:
findITResourceType in interface tcImportOperationsIntf
Parameters:
RootObject - obj
Returns:
RootObject IT Resource Type
Throws:
DDMException - Deployment Error
java.sql.SQLException - SQL Error

findITResourceTypeParams

public java.util.Collection findITResourceTypeParams(RootObject obj)
                                              throws java.sql.SQLException,
                                                     DDMException
Specified by:
findITResourceTypeParams in interface tcImportOperationsIntf
Parameters:
RootObject - obj
Returns:
Collection IT Resource Parameters
Throws:
DDMException - Deployment Error
java.sql.SQLException - SQL Error

addSubstitution

public void addSubstitution(RootObject robj,
                            java.lang.String name)
                     throws DDMException,
                            java.sql.SQLException
Create a substitutions for a given root object. Basically Deployment uses the new name provided instead of the old name contained in the exported files. Useful when the names are different in development and staging and production machines.
Specified by:
addSubstitution in interface tcImportOperationsIntf
Parameters:
robj -
name -
Throws:
DDMException
java.sql.SQLException

removeSubstitution

public void removeSubstitution(RootObject robj)
                        throws DDMException
Remove substitutions for a given root object
Specified by:
removeSubstitution in interface tcImportOperationsIntf
Parameters:
robj -
Throws:
DDMException

getSubstitutions

public java.util.HashMap getSubstitutions()
                                   throws DDMException
get the current substitutions
Specified by:
getSubstitutions in interface tcImportOperationsIntf
Returns:
current substitutions - Keys in the map are RootObjects and values are the new names.
Throws:
DDMException

performImport

public void performImport(java.util.Collection col)
                   throws DDMException,
                          javax.naming.NamingException,
                          tcBulkException
Perform the actual import operation on the selected objects.
Specified by:
performImport in interface tcImportOperationsIntf
Parameters:
col - Collection of root objects
Throws:
javax.naming.NamingException
DDMException - General Exception
tcBulkException
NamingException

getMissingDependencies

public java.util.Collection getMissingDependencies(java.util.Collection selection,
                                                   java.lang.String type)
                                            throws DDMException
Return list of missing dependencies. Find all the missing dependencies of the given selection. If a type is provided dependencies of that type are returned. The type specified here is the physical type and not logical type. I.e. Form implies both types of forms.
Specified by:
getMissingDependencies in interface tcImportOperationsIntf
Parameters:
selection - List of objects selected for import
type - Type of the objects interested in.
Returns:
List of missing dependencies. Collection contains objects of type RootObject.
Throws:
DDMException - General Exception

addConnectorPreviewedFile

public java.util.Collection addConnectorPreviewedFile(java.util.Collection col)
                                               throws DDMException,
                                                      UnableToAcquireLock
All the RootObjects which are being calculated for deletion are to be populated.
Parameters:
col - List of all root objects present in only old connector version.
Returns:
Collection of all RootObjects which are present only in the Old connector version
Throws:
DDMException
UnableToAcquireLock
Since:
11.1.1.4.0

getConnectorRootObjects

public java.util.Collection getConnectorRootObjects(java.lang.String type)
                                             throws DDMException,
                                                    UnableToAcquireLock
Returns a collection of RootObjects which are present in the connector XML file to be imported of a particular entity type.
Parameters:
type - connector object types retrieved from the xml file
Returns:
Collection of RootObjects which are present in the connector XML file to be imported
Throws:
UnableToAcquireLock
DDMException - Generic deployment manager exception
Since:
11.1.1.4.0

populateChildren

public void populateChildren(java.util.Collection oldObjects)
                      throws DDMException,
                             TransformationException,
                             UnableToAcquireLock
Populates the name value pairs to be saved to export this dependency. These name value pairs will later be used to resolve the dependency during the import.
Parameters:
oldObjects - collection of Objects to be deleted , so the deletion when triggered deleted the whole tree starting from the leaf.
Throws:
TransformationException - Transformation of the file failed
DDMException - Generic deployment manager exception
UnableToAcquireLock
Since:
11.1.1.4.0

getProcessTasks

public java.util.Collection getProcessTasks(java.util.Collection col)
                                     throws DDMException,
                                            TransformationException,
                                            UnableToAcquireLock
Returns Collection of TaskObjects containing details of all the process tasks to be taken care of during import
Parameters:
col - List of Collection of TaskObjects containing details of all the process tasks
Returns:
Collection of TaskObjects containing details of all the process tasks
Throws:
TransformationException - Transformation of the file failed
DDMException - Generic deployment manager exception
UnableToAcquireLock
Since:
11.1.1.4.0

updateTasks

public void updateTasks(TaskObject pt)
                 throws DDMException,
                        TransformationException,
                        UnableToAcquireLock
The TaskObject contain the details of a process Task which needs to be updated to check if it needs to be deleted/Imported
Parameters:
pt - TaskObject contain the details of a process Task to be updated
Throws:
TransformationException - Transformation of the file failed
DDMException - Generic deployment manager exception
UnableToAcquireLock
Since:
11.1.1.4.0

retrieveChildren

public java.util.Collection retrieveChildren(java.util.Collection objects)
                                      throws DDMException
Returns collection of RootObjects whose children need to be populated.
Parameters:
objects - Collection of RootObjects
Returns:
collection is of the RootObjects whose children need to be populated.
Throws:
DDMException
Since:
11.1.1.4.0

checkTasks

public java.lang.String checkTasks(TaskObject pt)
                            throws DDMException,
                                   TransformationException
It checks the dependency tasks to be available if a task is being imported/deleted.
Parameters:
pt - TaskObject containing the dependent tasks
Returns:
Error Code
Throws:
TransformationException - Transformation of the file failed
DDMException - Generic deployment manager exception
Since:
11.1.1.4.0

Skip navigation links


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.