org.pentaho.di.repository.kdr.delegates
Class KettleDatabaseRepositoryTransDelegate

java.lang.Object
  extended by org.pentaho.di.repository.kdr.delegates.KettleDatabaseRepositoryBaseDelegate
      extended by org.pentaho.di.repository.kdr.delegates.KettleDatabaseRepositoryTransDelegate

public class KettleDatabaseRepositoryTransDelegate
extends KettleDatabaseRepositoryBaseDelegate


Constructor Summary
KettleDatabaseRepositoryTransDelegate(KettleDatabaseRepository repository)
           
 
Method Summary
 int countTransParameter(ObjectId id_transformation)
          Count the number of parameters of a transaction.
 boolean existsTransMeta(String transname, RepositoryDirectory directory)
           
 boolean existsTransMeta(String name, RepositoryDirectoryInterface repositoryDirectory, RepositoryObjectType objectType)
           
 ObjectId getDependencyID(ObjectId id_transformation, ObjectId id_database, String tablename)
           
 int getNrTransDependencies(ObjectId id_transformation)
           
 int getNrTransformations(ObjectId id_directory)
           
 int getNrTransHops(ObjectId id_transformation)
           
 boolean getTransAttributeBoolean(ObjectId id_transformation, int nr, String code)
           
 long getTransAttributeInteger(ObjectId id_transformation, int nr, String code)
           
 String getTransAttributeString(ObjectId id_transformation, int nr, String code)
           
 RowMetaAndData getTransDependency(ObjectId id_dependency)
           
 RowMetaAndData getTransformation(ObjectId id_transformation)
           
 ObjectId getTransformationID(String name, ObjectId id_directory)
           
 String[] getTransformationsWithIDList(List<Object[]> list, RowMetaInterface rowMeta)
           
 String[] getTransformationsWithIDList(ObjectId[] ids)
           
 RowMetaAndData getTransHop(ObjectId id_trans_hop)
           
 ObjectId getTransHopID(ObjectId id_transformation, ObjectId id_step_from, ObjectId id_step_to)
           
 ObjectId[] getTransHopIDs(ObjectId id_transformation)
           
 String getTransParameterDefault(ObjectId id_transformation, int nr)
          Get a transformation parameter default.
 String getTransParameterDescription(ObjectId id_transformation, int nr)
          Get a transformation parameter description.
 String getTransParameterKey(ObjectId id_transformation, int nr)
          Get a transformation parameter key.
 void insertTransParameter(ObjectId id_transformation, long nr, String key, String defValue, String description)
          Insert a parameter for a transformation in the repository.
 TransDependency loadTransDependency(ObjectId id_dependency, List<DatabaseMeta> databases)
           
 TransMeta loadTransformation(TransMeta transMeta, String transname, RepositoryDirectoryInterface repdir, ProgressMonitorListener monitor, boolean setInternalVariables)
          Read a transformation with a certain name from a repository
 TransHopMeta loadTransHopMeta(ObjectId id_trans_hop, List<StepMeta> steps)
           
 void moveTransformation(String transname, ObjectId id_directory_from, ObjectId id_directory_to)
           
 void readClusters(TransMeta transMeta, boolean overWriteShared)
          Read the clusters in the repository and add them to this transformation if they are not yet present.
 void readDatabases(TransMeta transMeta, boolean overWriteShared)
          Read all the databases from the repository, insert into the TransMeta object, overwriting optionally
 void readPartitionSchemas(TransMeta transMeta, boolean overWriteShared)
          Read the partitions in the repository and add them to this transformation if they are not yet present.
 void readSlaves(TransMeta transMeta, boolean overWriteShared)
          Read the slave servers in the repository and add them to this transformation if they are not yet present.
 SharedObjects readTransSharedObjects(TransMeta transMeta)
           
 void renameTransformation(ObjectId id_transformation, RepositoryDirectoryInterface newParentDir, String newname)
           
 void saveTransDependency(TransDependency transDependency, ObjectId id_transformation)
           
 void saveTransformation(TransMeta transMeta, String versionComment, ProgressMonitorListener monitor, boolean overwriteAssociated)
          Saves the transformation to a repository.
 void saveTransHopMeta(TransHopMeta transHopMeta, ObjectId id_transformation)
           
 void saveTransParameters(TransMeta transMeta)
          Save the parameters of this transformation to the repository.
 
Methods inherited from class org.pentaho.di.repository.kdr.delegates.KettleDatabaseRepositoryBaseDelegate
quote, quoteTable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KettleDatabaseRepositoryTransDelegate

public KettleDatabaseRepositoryTransDelegate(KettleDatabaseRepository repository)
Method Detail

getTransformation

public RowMetaAndData getTransformation(ObjectId id_transformation)
                                 throws KettleException
Throws:
KettleException

getTransHop

public RowMetaAndData getTransHop(ObjectId id_trans_hop)
                           throws KettleException
Throws:
KettleException

getTransDependency

public RowMetaAndData getTransDependency(ObjectId id_dependency)
                                  throws KettleException
Throws:
KettleException

existsTransMeta

public boolean existsTransMeta(String name,
                               RepositoryDirectoryInterface repositoryDirectory,
                               RepositoryObjectType objectType)
                        throws KettleException
Throws:
KettleException

getTransformationID

public ObjectId getTransformationID(String name,
                                    ObjectId id_directory)
                             throws KettleException
Throws:
KettleException

getTransHopID

public ObjectId getTransHopID(ObjectId id_transformation,
                              ObjectId id_step_from,
                              ObjectId id_step_to)
                       throws KettleException
Throws:
KettleException

getDependencyID

public ObjectId getDependencyID(ObjectId id_transformation,
                                ObjectId id_database,
                                String tablename)
                         throws KettleException
Throws:
KettleException

saveTransformation

public void saveTransformation(TransMeta transMeta,
                               String versionComment,
                               ProgressMonitorListener monitor,
                               boolean overwriteAssociated)
                        throws KettleException
Saves the transformation to a repository.

Parameters:
transMeta - the transformation metadata to store
monitor - the way we report progress to the user, can be null if no UI is present
overwrite - Overwrite existing object(s)?
Throws:
KettleException - if an error occurs.

saveTransParameters

public void saveTransParameters(TransMeta transMeta)
                         throws KettleException
Save the parameters of this transformation to the repository.

Parameters:
rep - The repository to save to.
Throws:
KettleException - Upon any error. TODO: Move this code over to the Repository class for refactoring...

loadTransformation

public TransMeta loadTransformation(TransMeta transMeta,
                                    String transname,
                                    RepositoryDirectoryInterface repdir,
                                    ProgressMonitorListener monitor,
                                    boolean setInternalVariables)
                             throws KettleException
Read a transformation with a certain name from a repository

Parameters:
rep - The repository to read from.
transname - The name of the transformation.
repdir - the path to the repository directory
monitor - The progress monitor to display the progress of the file-open operation in a dialog
setInternalVariables - true if you want to set the internal variables based on this transformation information
Throws:
KettleException

countTransParameter

public int countTransParameter(ObjectId id_transformation)
                        throws KettleException
Count the number of parameters of a transaction.

Parameters:
id_transformation - transformation id
Returns:
the number of transactions
Throws:
KettleException - Upon any error.

getTransParameterKey

public String getTransParameterKey(ObjectId id_transformation,
                                   int nr)
                            throws KettleException
Get a transformation parameter key. You can count the number of parameters up front.

Parameters:
id_transformation - transformation id
nr - number of the parameter
Returns:
they key/name of specified parameter
Throws:
KettleException - Upon any error.

getTransParameterDefault

public String getTransParameterDefault(ObjectId id_transformation,
                                       int nr)
                                throws KettleException
Get a transformation parameter default. You can count the number of parameters up front.

Parameters:
id_transformation - transformation id
nr - number of the parameter
Returns:
Throws:
KettleException - Upon any error.

getTransParameterDescription

public String getTransParameterDescription(ObjectId id_transformation,
                                           int nr)
                                    throws KettleException
Get a transformation parameter description. You can count the number of parameters up front.

Parameters:
id_transformation - transformation id
nr - number of the parameter
Returns:
Throws:
KettleException - Upon any error.

insertTransParameter

public void insertTransParameter(ObjectId id_transformation,
                                 long nr,
                                 String key,
                                 String defValue,
                                 String description)
                          throws KettleException
Insert a parameter for a transformation in the repository.

Parameters:
id_transformation - transformation id
nr - number of the parameter to insert
key - key to insert
defValue - default value
description - description to insert
Throws:
KettleException - Upon any error.

readDatabases

public void readDatabases(TransMeta transMeta,
                          boolean overWriteShared)
                   throws KettleException
Read all the databases from the repository, insert into the TransMeta object, overwriting optionally

Parameters:
TransMeta - The transformation to load into.
overWriteShared - if an object with the same name exists, overwrite
Throws:
KettleException

readClusters

public void readClusters(TransMeta transMeta,
                         boolean overWriteShared)
                  throws KettleException
Read the clusters in the repository and add them to this transformation if they are not yet present.

Parameters:
TransMeta - The transformation to load into.
overWriteShared - if an object with the same name exists, overwrite
Throws:
KettleException

readPartitionSchemas

public void readPartitionSchemas(TransMeta transMeta,
                                 boolean overWriteShared)
                          throws KettleException
Read the partitions in the repository and add them to this transformation if they are not yet present.

Parameters:
TransMeta - The transformation to load into.
overWriteShared - if an object with the same name exists, overwrite
Throws:
KettleException

readSlaves

public void readSlaves(TransMeta transMeta,
                       boolean overWriteShared)
                throws KettleException
Read the slave servers in the repository and add them to this transformation if they are not yet present.

Parameters:
TransMeta - The transformation to load into.
overWriteShared - if an object with the same name exists, overwrite
Throws:
KettleException

loadTransDependency

public TransDependency loadTransDependency(ObjectId id_dependency,
                                           List<DatabaseMeta> databases)
                                    throws KettleException
Throws:
KettleException

saveTransDependency

public void saveTransDependency(TransDependency transDependency,
                                ObjectId id_transformation)
                         throws KettleException
Throws:
KettleException

saveTransHopMeta

public void saveTransHopMeta(TransHopMeta transHopMeta,
                             ObjectId id_transformation)
                      throws KettleException
Throws:
KettleException

loadTransHopMeta

public TransHopMeta loadTransHopMeta(ObjectId id_trans_hop,
                                     List<StepMeta> steps)
                              throws KettleException
Throws:
KettleException

getNrTransformations

public int getNrTransformations(ObjectId id_directory)
                         throws KettleException
Throws:
KettleException

getNrTransHops

public int getNrTransHops(ObjectId id_transformation)
                   throws KettleException
Throws:
KettleException

getNrTransDependencies

public int getNrTransDependencies(ObjectId id_transformation)
                           throws KettleException
Throws:
KettleException

getTransformationsWithIDList

public String[] getTransformationsWithIDList(List<Object[]> list,
                                             RowMetaInterface rowMeta)
                                      throws KettleException
Throws:
KettleException

getTransformationsWithIDList

public String[] getTransformationsWithIDList(ObjectId[] ids)
                                      throws KettleException
Throws:
KettleException

existsTransMeta

public boolean existsTransMeta(String transname,
                               RepositoryDirectory directory)
                        throws KettleException
Throws:
KettleException

getTransHopIDs

public ObjectId[] getTransHopIDs(ObjectId id_transformation)
                          throws KettleException
Throws:
KettleException

getTransAttributeBoolean

public boolean getTransAttributeBoolean(ObjectId id_transformation,
                                        int nr,
                                        String code)
                                 throws KettleException
Throws:
KettleException

getTransAttributeString

public String getTransAttributeString(ObjectId id_transformation,
                                      int nr,
                                      String code)
                               throws KettleException
Throws:
KettleException

getTransAttributeInteger

public long getTransAttributeInteger(ObjectId id_transformation,
                                     int nr,
                                     String code)
                              throws KettleException
Throws:
KettleException

readTransSharedObjects

public SharedObjects readTransSharedObjects(TransMeta transMeta)
                                     throws KettleException
Throws:
KettleException

moveTransformation

public void moveTransformation(String transname,
                               ObjectId id_directory_from,
                               ObjectId id_directory_to)
                        throws KettleException
Throws:
KettleException

renameTransformation

public void renameTransformation(ObjectId id_transformation,
                                 RepositoryDirectoryInterface newParentDir,
                                 String newname)
                          throws KettleException
Throws:
KettleException