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

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

public class KettleDatabaseRepositoryJobDelegate
extends KettleDatabaseRepositoryBaseDelegate


Constructor Summary
KettleDatabaseRepositoryJobDelegate(KettleDatabaseRepository repository)
           
 
Method Summary
 int countJobParameter(ObjectId id_job)
          Count the number of parameters of a job.
 boolean existsJobMeta(String name, RepositoryDirectoryInterface repositoryDirectory, RepositoryObjectType objectType)
           
 RowMetaAndData getJob(ObjectId id_job)
           
 boolean getJobAttributeBoolean(ObjectId id_job, int nr, String code)
           
 long getJobAttributeInteger(ObjectId id_job, int nr, String code)
           
 String getJobAttributeString(ObjectId id_job, int nr, String code)
           
 RowMetaAndData getJobHop(ObjectId id_job_hop)
           
 ObjectId getJobHopID(ObjectId id_job, ObjectId id_jobentry_copy_from, ObjectId id_jobentry_copy_to)
           
 ObjectId getJobID(String name, ObjectId id_directory)
           
 String getJobParameterDefault(ObjectId id_job, int nr)
          Get a job parameter default.
 String getJobParameterDescription(ObjectId id_job, int nr)
          Get a job parameter description.
 String getJobParameterKey(ObjectId id_job, int nr)
          Get a job parameter key.
 String[] getJobsWithIDList(List<Object[]> list, RowMetaInterface rowMeta)
           
 String[] getJobsWithIDList(ObjectId[] ids)
           
 int getNrJobHops(ObjectId id_job)
           
 int getNrJobs()
           
 int getNrJobs(ObjectId id_directory)
           
 ObjectId insertJobHop(ObjectId id_job, ObjectId id_jobentry_copy_from, ObjectId id_jobentry_copy_to, boolean enabled, boolean evaluation, boolean unconditional)
           
 void insertJobParameter(ObjectId id_job, long nr, String key, String defValue, String description)
          Insert a parameter for a job in the repository.
 JobHopMeta loadJobHopMeta(ObjectId id_job_hop, List<JobEntryCopy> jobcopies)
           
 JobMeta loadJobMeta(String jobname, RepositoryDirectoryInterface repdir)
          Load a job from the repository
 JobMeta loadJobMeta(String jobname, RepositoryDirectoryInterface repdir, ProgressMonitorListener monitor)
          Load a job in a directory
 void moveJob(String jobname, ObjectId id_directory_from, ObjectId id_directory_to)
           
 void readDatabases(JobMeta jobMeta)
          Read the database connections in the repository and add them to this job if they are not yet present.
 void readDatabases(JobMeta jobMeta, boolean overWriteShared)
          Read the database connections in the repository and add them to this job if they are not yet present.
 SharedObjects readSharedObjects(JobMeta jobMeta)
           
 void readSlaves(JobMeta jobMeta, boolean overWriteShared)
          Read the slave servers in the repository and add them to this transformation if they are not yet present.
 void renameJob(ObjectId id_job, RepositoryDirectoryInterface newParentDir, String newname)
           
 void saveJob(JobMeta jobMeta, String versionComment, ProgressMonitorListener monitor, boolean overwrite)
          Stored a job in the repository
 void saveJobHopMeta(JobHopMeta hop, ObjectId id_job)
           
 
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

KettleDatabaseRepositoryJobDelegate

public KettleDatabaseRepositoryJobDelegate(KettleDatabaseRepository repository)
Method Detail

getJob

public RowMetaAndData getJob(ObjectId id_job)
                      throws KettleException
Throws:
KettleException

getJobHop

public RowMetaAndData getJobHop(ObjectId id_job_hop)
                         throws KettleException
Throws:
KettleException

getJobHopID

public ObjectId getJobHopID(ObjectId id_job,
                            ObjectId id_jobentry_copy_from,
                            ObjectId id_jobentry_copy_to)
                     throws KettleException
Throws:
KettleException

saveJob

public void saveJob(JobMeta jobMeta,
                    String versionComment,
                    ProgressMonitorListener monitor,
                    boolean overwrite)
             throws KettleException
Stored a job in the repository

Parameters:
jobMeta - The job to store
monitor - the (optional) UI progress monitor
overwrite - Overwrite existing object(s)?
Throws:
KettleException - in case some IO error occurs.

existsJobMeta

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

loadJobMeta

public JobMeta loadJobMeta(String jobname,
                           RepositoryDirectoryInterface repdir)
                    throws KettleException
Load a job from the repository

Parameters:
jobname - The name of the job
repdir - The directory in which the job resides.
Throws:
KettleException

loadJobMeta

public JobMeta loadJobMeta(String jobname,
                           RepositoryDirectoryInterface repdir,
                           ProgressMonitorListener monitor)
                    throws KettleException
Load a job in a directory

Parameters:
log - the logging channel
rep - The Repository
jobname - The name of the job
repdir - The directory in which the job resides.
Throws:
KettleException

getJobParameterKey

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

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

getJobParameterDefault

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

Parameters:
id_job - job id
nr - number of the parameter
Returns:
the default value of the parameter
Throws:
KettleException - Upon any error.

getJobParameterDescription

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

Parameters:
id_job - job id
nr - number of the parameter
Returns:
the description of the parameter
Throws:
KettleException - Upon any error.

insertJobParameter

public void insertJobParameter(ObjectId id_job,
                               long nr,
                               String key,
                               String defValue,
                               String description)
                        throws KettleException
Insert a parameter for a job in the repository.

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

countJobParameter

public int countJobParameter(ObjectId id_job)
                      throws KettleException
Count the number of parameters of a job.

Parameters:
id_job - job id
Returns:
the number of of parameters of the job
Throws:
KettleException - Upon any error.

loadJobHopMeta

public JobHopMeta loadJobHopMeta(ObjectId id_job_hop,
                                 List<JobEntryCopy> jobcopies)
                          throws KettleException
Throws:
KettleException

saveJobHopMeta

public void saveJobHopMeta(JobHopMeta hop,
                           ObjectId id_job)
                    throws KettleException
Throws:
KettleException

readDatabases

public void readDatabases(JobMeta jobMeta)
                   throws KettleException
Read the database connections in the repository and add them to this job if they are not yet present.

Parameters:
jobMeta - the job to put the database connections in
Throws:
KettleException

readDatabases

public void readDatabases(JobMeta jobMeta,
                          boolean overWriteShared)
                   throws KettleException
Read the database connections in the repository and add them to this job if they are not yet present.

Parameters:
jobMeta - the job to put the database connections in
overWriteShared - set to true if you want to overwrite shared connections while loading.
Throws:
KettleException

readSlaves

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

Parameters:
jobMeta - The job to put the slave servers in
overWriteShared - if an object with the same name exists, overwrite
Throws:
KettleException

readSharedObjects

public SharedObjects readSharedObjects(JobMeta jobMeta)
                                throws KettleException
Throws:
KettleException

getJobID

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

getNrJobs

public int getNrJobs()
              throws KettleException
Throws:
KettleException

getNrJobs

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

getNrJobHops

public int getNrJobHops(ObjectId id_job)
                 throws KettleException
Throws:
KettleException

getJobsWithIDList

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

getJobsWithIDList

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

insertJobHop

public ObjectId insertJobHop(ObjectId id_job,
                             ObjectId id_jobentry_copy_from,
                             ObjectId id_jobentry_copy_to,
                             boolean enabled,
                             boolean evaluation,
                             boolean unconditional)
                      throws KettleException
Throws:
KettleException

getJobAttributeString

public String getJobAttributeString(ObjectId id_job,
                                    int nr,
                                    String code)
                             throws KettleException
Throws:
KettleException

getJobAttributeInteger

public long getJobAttributeInteger(ObjectId id_job,
                                   int nr,
                                   String code)
                            throws KettleException
Throws:
KettleException

getJobAttributeBoolean

public boolean getJobAttributeBoolean(ObjectId id_job,
                                      int nr,
                                      String code)
                               throws KettleException
Throws:
KettleException

moveJob

public void moveJob(String jobname,
                    ObjectId id_directory_from,
                    ObjectId id_directory_to)
             throws KettleException
Throws:
KettleException

renameJob

public void renameJob(ObjectId id_job,
                      RepositoryDirectoryInterface newParentDir,
                      String newname)
               throws KettleException
Throws:
KettleException