com.informatica.powercenter.sdk.mapfwk.reputils
Class CachedRepositoryConnectionManager

java.lang.Object
  extended by com.informatica.powercenter.sdk.mapfwk.reputils.RepositoryConnectionManager
      extended by com.informatica.powercenter.sdk.mapfwk.reputils.CachedRepositoryConnectionManager

public class CachedRepositoryConnectionManager
extends RepositoryConnectionManager

class used to cache the objects retreived from PowerCenter Repository


Field Summary
static int PURGE_ALL
           
static int PURGE_UNMODIFIED
          Reset the cache.
 
Fields inherited from class com.informatica.powercenter.sdk.mapfwk.reputils.RepositoryConnectionManager
rep
 
Constructor Summary
CachedRepositoryConnectionManager(RepositoryConnectionManager mgr)
           
 
Method Summary
protected  void _connect()
          connect to PowerCenter Repository
protected  void _createConnection(ConnectionObject connObj)
          creates a connection defined by the ConnectionObject
protected  void _deleteConnection(java.lang.String connectionType, java.lang.String connectionName)
          deletes a connection specified by the connectionType and connectionName
protected  int _importObjectIntoRepository(java.lang.String importFileName, java.lang.String controlFileName)
          This will import the objects that are present in the xml file defined by importFileName.
protected  java.util.Vector _listConnections(java.lang.String strSubType, NameFilter filter)
          return list of connections of particular type matching the filter, in PowerCenter repository
protected  java.util.Vector _listFolders(NameFilter filter)
          return list of folders in PowerCenter Repository
protected  java.util.Vector _listMappings(Folder folder, NameFilter filter)
          return list of mappings matching the filter, in particular folder of a repository
protected  java.util.Vector _listMapplets(Folder folder, NameFilter filter)
          return list of mapplets matching the filter, in particular folder of a repository
protected  java.util.Vector _listSourceNames(Folder folder)
          Abstract method to list all the source names in the specific folder.
protected  java.util.Vector _listSources(Folder folder, NameFilter filter)
          Return list of sources matching the filter, in particular folder of a repository.
protected  java.util.Vector _listTargetNames(Folder folder)
          Abstract method to list all the target names in the specific folder.
protected  java.util.Vector _listTargets(Folder folder, NameFilter filter)
          return list of targets matching the filter, in particular folder of a repository
protected  java.util.Vector _listTransformations(Folder folder, int subType, NameFilter filter)
          return list of sources of particular subtype matching the filter, in particular folder of a repository
protected  java.util.Vector _listWorkflows(Folder folder, NameFilter filter)
          return list of workflows matching the filter, in particular folder of a repository
protected  void _updateConnection(ConnectionObject connObj)
          updates a connection defined by the ConnectionObject
protected  boolean _validate(java.lang.String objectName, java.lang.String objectType, java.lang.String folderName, boolean save)
          Validate the object in the repository.
protected  boolean _validate(java.lang.String objectName, java.lang.String objectType, java.lang.String folderName, boolean save, java.io.Writer dataOut)
          Validate the object in the repository.
 java.util.Vector listModifiedFolders()
          Returns the list of folders that have been modified in the cache.
 void resetCacheContents(int purgelevel)
           
 
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.reputils.RepositoryConnectionManager
connect, createConnection, deleteConnection, importObjectIntoRepository, listConnections, listConnections, listConnections, listConnections, listFolders, listFolders, listMappings, listMappings, listMapplets, listMapplets, listSourceNames, listSources, listSources, listTargetNames, listTargets, listTargets, listTransformations, listTransformations, listTransformations, listTransformations, listWorkflows, listWorkflows, reconnect, setRepository, updateConnection, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PURGE_UNMODIFIED

public static final int PURGE_UNMODIFIED
Reset the cache. If the parameter is true, it will purge only the folders that were not modified. All folders whose elements have been modified ( that is, all members that have been marked modified using setModified(boolean)) will be retained and the remaining folders will be purged. If the parameter is false, then the entire cache would be purged, and all modifications would be lost. Note: If modified folders have been added to the repository using the Repository.addFolder(), then the changes can be retained as the reference is preserved. connmgr.listFolders(); ... connmgr.resetCacheContents(connmgr.PURGE_UNMODIFIED);

See Also:
Constant Field Values

PURGE_ALL

public static final int PURGE_ALL
See Also:
Constant Field Values
Constructor Detail

CachedRepositoryConnectionManager

public CachedRepositoryConnectionManager(RepositoryConnectionManager mgr)
Parameters:
mgr -
Method Detail

resetCacheContents

public void resetCacheContents(int purgelevel)

_connect

protected void _connect()
                 throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
connect to PowerCenter Repository

Specified by:
_connect in class RepositoryConnectionManager
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException

_listFolders

protected java.util.Vector _listFolders(NameFilter filter)
                                 throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
return list of folders in PowerCenter Repository

Specified by:
_listFolders in class RepositoryConnectionManager
Parameters:
filter - Filter to be applied on the name of the objects. Can be null, in which case all objects should be returned.
Returns:
list of folders in PowerCenter Repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException

listModifiedFolders

public java.util.Vector listModifiedFolders()
Returns the list of folders that have been modified in the cache.

Returns:
Vector

_listSources

protected java.util.Vector _listSources(Folder folder,
                                        NameFilter filter)
                                 throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                        com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                        com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
Return list of sources matching the filter, in particular folder of a repository. The cache is initialized when the user makes a call to listSources() without the filter. After the cache is initialzed, every subsequent call returns a copy built from the cache list. When cache is not initialized, and call is made to listSources() with filter, the API makes an actual call to the repsoitory and returns it without updating the cache.

Specified by:
_listSources in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the sources
filter - filter for filtering the sources by name. Can be null, in which case all objects should be returned
Returns:
list of sources in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listTargets

protected java.util.Vector _listTargets(Folder folder,
                                        NameFilter filter)
                                 throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                        com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                        com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
return list of targets matching the filter, in particular folder of a repository

Specified by:
_listTargets in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the targets
filter - filter for filtering the targets by name. Can be null, in which case all objects should be returned
Returns:
list of sources in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listTransformations

protected java.util.Vector _listTransformations(Folder folder,
                                                int subType,
                                                NameFilter filter)
                                         throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                                com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                                com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
return list of sources of particular subtype matching the filter, in particular folder of a repository

Specified by:
_listTransformations in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the transformations
subType - the transformation type for which transformations are returned. @see TransformationConstants
filter - filter for filtering the transformations by name. Can be null, in which case all objects should be returned
Returns:
list of transformations in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listMapplets

protected java.util.Vector _listMapplets(Folder folder,
                                         NameFilter filter)
                                  throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                         com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                         com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
return list of mapplets matching the filter, in particular folder of a repository

Specified by:
_listMapplets in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the mapplets
filter - filter for filtering the mapplets by name. Can be null, in which case all objects should be returned
Returns:
list of mapplets in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listMappings

protected java.util.Vector _listMappings(Folder folder,
                                         NameFilter filter)
                                  throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                         com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                         com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
return list of mappings matching the filter, in particular folder of a repository

Specified by:
_listMappings in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the mappings
filter - filter for filtering the mappings by name. Can be null, in which case all objects should be returned
Returns:
list of mappings in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listWorkflows

protected java.util.Vector _listWorkflows(Folder folder,
                                          NameFilter filter)
                                   throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                          com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                          com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
return list of workflows matching the filter, in particular folder of a repository

Specified by:
_listWorkflows in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the workflows
filter - filter for filtering the workflows by name. Can be null, in which case all objects should be returned
Returns:
list of workflows in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listConnections

protected java.util.Vector _listConnections(java.lang.String strSubType,
                                            NameFilter filter)
                                     throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
return list of connections of particular type matching the filter, in PowerCenter repository

Specified by:
_listConnections in class RepositoryConnectionManager
Parameters:
strSubType - the connection subtype for which connections should be retrieved.
filter - filter for filtering the connections by name. Can be null, in which case all objects should be returned
Returns:
list of ConnectionObject in repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException

_createConnection

protected void _createConnection(ConnectionObject connObj)
                          throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionAlreadyExistsException,
                                 com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                 com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionCreationFailedException
creates a connection defined by the ConnectionObject

Specified by:
_createConnection in class RepositoryConnectionManager
Parameters:
connObj - The connection object that should be used for creating the connection
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionAlreadyExistsException
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionCreationFailedException

_deleteConnection

protected void _deleteConnection(java.lang.String connectionType,
                                 java.lang.String connectionName)
                          throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                 com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionDoesNotExistException
deletes a connection specified by the connectionType and connectionName

Specified by:
_deleteConnection in class RepositoryConnectionManager
connectionName - Name of the connection to be deleted
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionDoesNotExistException

_validate

protected boolean _validate(java.lang.String objectName,
                            java.lang.String objectType,
                            java.lang.String folderName,
                            boolean save)
                     throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                            com.informatica.powercenter.sdk.mapfwk.exceptions.ValidationFailedException
Description copied from class: RepositoryConnectionManager
Validate the object in the repository. Returns true if the object is valid, else returns false

Specified by:
_validate in class RepositoryConnectionManager
Parameters:
objectName - objectName to validate
objectType - objectType
folderName - the folder in which the object exists
save - Save invalid objects that became valid after validation
Returns:
boolean
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.ValidationFailedException

_validate

protected boolean _validate(java.lang.String objectName,
                            java.lang.String objectType,
                            java.lang.String folderName,
                            boolean save,
                            java.io.Writer dataOut)
                     throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                            com.informatica.powercenter.sdk.mapfwk.exceptions.ValidationFailedException,
                            java.io.IOException
Description copied from class: RepositoryConnectionManager
Validate the object in the repository. Returns true if the object is valid, else returns false

Specified by:
_validate in class RepositoryConnectionManager
Parameters:
objectName - objectName to validate
objectType - objectType
folderName - the folder in which the object exists
save - Save invalid objects that became valid after validation
dataOut - Writer to which summary information is to be written
Returns:
boolean
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
java.io.IOException
com.informatica.powercenter.sdk.mapfwk.exceptions.ValidationFailedException

_updateConnection

protected void _updateConnection(ConnectionObject connObj)
                          throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                 com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionUpdateFailedException
updates a connection defined by the ConnectionObject

Specified by:
_updateConnection in class RepositoryConnectionManager
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionUpdateFailedException

_importObjectIntoRepository

protected int _importObjectIntoRepository(java.lang.String importFileName,
                                          java.lang.String controlFileName)
                                   throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                          MapFwkOutputException
Description copied from class: RepositoryConnectionManager
This will import the objects that are present in the xml file defined by importFileName. The controFile specified by controlFileName will be used to determine which folder the objects will be imported to.

Specified by:
_importObjectIntoRepository in class RepositoryConnectionManager
Parameters:
importFileName - The complete path of the xml file that is to be imported.
controlFileName - The complete path of the control file.
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
MapFwkOutputException

_listSourceNames

protected java.util.Vector _listSourceNames(Folder folder)
                                     throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                            com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                            com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
Description copied from class: RepositoryConnectionManager
Abstract method to list all the source names in the specific folder.

Specified by:
_listSourceNames in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the source names
Returns:
list of source names in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException

_listTargetNames

protected java.util.Vector _listTargetNames(Folder folder)
                                     throws com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException,
                                            com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException,
                                            com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException
Description copied from class: RepositoryConnectionManager
Abstract method to list all the target names in the specific folder.

Specified by:
_listTargetNames in class RepositoryConnectionManager
Parameters:
folder - the folder that contains the target names
Returns:
list of target names in particular folder of a repository
Throws:
com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException
com.informatica.powercenter.sdk.mapfwk.exceptions.FolderNotFoundException
com.informatica.powercenter.sdk.mapfwk.exceptions.ObjectFetchFailedException