Thor.API.Operations
Interface tcImportOperationsIntf


public interface tcImportOperationsIntf


Method Summary
 void acquireLock(boolean forcedAcquisition)
          Try to acquire the lock
 java.util.Collection addLastPreviewedFile()
          Add the file previewed before into the files to be imported.
 void addSubstitution(com.thortech.xl.vo.ddm.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.
 com.thortech.xl.vo.ddm.RootObject findITResourceType(com.thortech.xl.vo.ddm.RootObject obj)
           
 java.util.Collection findITResourceTypeParams(com.thortech.xl.vo.ddm.RootObject obj)
           
 com.thortech.xl.vo.ddm.LockOwner getCurrentLockInfo()
          Return information about the current owner of the lock
 java.util.Collection getFileList()
          Retrieve list of files currently added for import
 com.thortech.xl.vo.ddm.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.
 com.thortech.xl.vo.ddm.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.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.
 java.util.Collection removeFiles(java.util.Collection filenames)
          Removes the selected XML Files and recomputes what is going to happen.
 void removeSubstitution(com.thortech.xl.vo.ddm.RootObject robj)
          Remove substitutions for a given root object
 

Method Detail

isLockAcquired

public boolean isLockAcquired()
                       throws tcAPIException
Check to see if we have the lock

Returns:
Did the current bean have the lock
Throws:
tcAPIException

getCurrentLockInfo

public com.thortech.xl.vo.ddm.LockOwner getCurrentLockInfo()
                                                    throws tcAPIException
Return information about the current owner of the lock

Returns:
Throws:
tcAPIException

acquireLock

public void acquireLock(boolean forcedAcquisition)
                 throws java.sql.SQLException,
                        javax.naming.NamingException,
                        com.thortech.xl.ddm.exception.DDMException,
                        tcAPIException
Try to acquire the lock

Parameters:
forcedAcquisition - True, if lock must be acquired regardless of another import in progress
Throws:
SQLException
NamingException
UnableToAcquireLock
com.thortech.xl.ddm.exception.DDMException
tcAPIException

addXMLFile

public java.util.Collection addXMLFile(java.lang.String filename,
                                       java.lang.String content)
                                throws com.thortech.xl.ddm.exception.DDMException,
                                       java.sql.SQLException,
                                       com.thortech.xl.ddm.exception.TransformationException,
                                       tcAPIException
Add a new XML File to import some more objects in the current session.

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
SQLException - Generic database error
TransformationException - Input file version is different from the current version and transformation of the data to current version failed.
DuplicateObjectException - Same object is also being imported from a different file.
tcAPIException

removeFiles

public java.util.Collection removeFiles(java.util.Collection filenames)
                                 throws com.thortech.xl.ddm.exception.DDMException,
                                        java.sql.SQLException,
                                        com.thortech.xl.ddm.exception.TransformationException,
                                        tcAPIException
Removes the selected XML Files and recomputes what is going to happen. Very expensive call in terms of computation.

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
SQLException - Generic database error during merging
TransformationException - Input versions cannot be transformed to current version
tcAPIException

getFilePreview

public com.thortech.xl.vo.ddm.FilePreview getFilePreview(java.lang.String filename,
                                                         java.lang.String content)
                                                  throws com.thortech.xl.ddm.exception.DDMException,
                                                         com.thortech.xl.ddm.exception.TransformationException,
                                                         tcAPIException
Get the preview of a file. File name, who exported it, source database etc

Returns:
Throws:
DDMException
TransformationException - Transformation of the file failed
DuplicateObjectException - When the file being added conflicts with another objects
DDMException - Generic deployment manager exception
tcAPIException

getFileList

public java.util.Collection getFileList()
                                 throws com.thortech.xl.ddm.exception.DDMException,
                                        tcAPIException
Retrieve list of files currently added for import

Returns:
Return list of files being imported. Contains the FilePreview objects.
Throws:
com.thortech.xl.ddm.exception.DDMException
tcAPIException

addLastPreviewedFile

public java.util.Collection addLastPreviewedFile()
                                          throws java.sql.SQLException,
                                                 com.thortech.xl.ddm.exception.DDMException,
                                                 tcAPIException
Add the file previewed before into the files to be imported.

Returns:
List of objects found in the file just added
Throws:
SQLException
DDMException
tcAPIException

getImportMessages

public java.util.HashMap getImportMessages(java.util.Collection col)
                                    throws com.thortech.xl.ddm.exception.DDMException,
                                           java.sql.SQLException,
                                           tcAPIException
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.

Parameters:
col -
Returns:
Return import plan
Throws:
com.thortech.xl.ddm.exception.DDMException
java.sql.SQLException
tcAPIException

getImportView

public com.thortech.xl.vo.ddm.ImportView getImportView(java.util.Collection col)
                                                throws com.thortech.xl.ddm.exception.DDMException,
                                                       java.sql.SQLException,
                                                       tcAPIException
Get the import view. This is to be used by the webclient to get the information to be displayed.

Parameters:
col -
Returns:
Throws:
DDMException
SQLException
tcAPIException

listPossibleSubstitutions

public java.util.Collection listPossibleSubstitutions(java.util.Collection col)
                                               throws java.sql.SQLException,
                                                      com.thortech.xl.ddm.exception.DDMException,
                                                      tcAPIException
Return a list of root objects that allow substitions, and are dependencies to the objects passed as collection. This is primarily used by webclient.

Parameters:
col - collection of objects for which substitutions can be made
Returns:
substitutable dependencies
Throws:
DDMException - Deployment Error
SQLException - SQL Error
tcAPIException

findITResourceType

public com.thortech.xl.vo.ddm.RootObject findITResourceType(com.thortech.xl.vo.ddm.RootObject obj)
                                                     throws java.sql.SQLException,
                                                            com.thortech.xl.ddm.exception.DDMException,
                                                            tcAPIException
Throws:
java.sql.SQLException
com.thortech.xl.ddm.exception.DDMException
tcAPIException

findITResourceTypeParams

public java.util.Collection findITResourceTypeParams(com.thortech.xl.vo.ddm.RootObject obj)
                                              throws java.sql.SQLException,
                                                     com.thortech.xl.ddm.exception.DDMException,
                                                     tcAPIException
Throws:
java.sql.SQLException
com.thortech.xl.ddm.exception.DDMException
tcAPIException

addSubstitution

public void addSubstitution(com.thortech.xl.vo.ddm.RootObject robj,
                            java.lang.String name)
                     throws com.thortech.xl.ddm.exception.DDMException,
                            java.sql.SQLException,
                            tcAPIException
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.

Parameters:
robj -
name -
Throws:
com.thortech.xl.ddm.exception.DDMException
java.sql.SQLException
tcAPIException

removeSubstitution

public void removeSubstitution(com.thortech.xl.vo.ddm.RootObject robj)
                        throws com.thortech.xl.ddm.exception.DDMException,
                               tcAPIException
Remove substitutions for a given root object

Parameters:
robj -
Throws:
com.thortech.xl.ddm.exception.DDMException
tcAPIException

getSubstitutions

public java.util.HashMap getSubstitutions()
                                   throws com.thortech.xl.ddm.exception.DDMException,
                                          tcAPIException
get the current substitutions

Returns:
current substitutions - Keys in the map are RootObjects and values are the new names.
Throws:
com.thortech.xl.ddm.exception.DDMException
tcAPIException

performImport

public void performImport(java.util.Collection col)
                   throws com.thortech.xl.ddm.exception.DDMException,
                          java.sql.SQLException,
                          javax.naming.NamingException,
                          tcAPIException
Perform the actual import operation on the selected objects.

Parameters:
col -
Throws:
NamingException
SQLException
DDMException - General Exception
tcAPIException

getMissingDependencies

public java.util.Collection getMissingDependencies(java.util.Collection selection,
                                                   java.lang.String type)
                                            throws com.thortech.xl.ddm.exception.DDMException,
                                                   java.sql.SQLException,
                                                   tcAPIException
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.

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:
com.thortech.xl.ddm.exception.DDMException
java.sql.SQLException
tcAPIException


Copyright © 1991, 2006 Oracle. All rights reserved.