Search in sources :

Example 41 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryMssqlBulkLoad method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    ResourceReference reference = null;
    if (connection != null) {
        reference = new ResourceReference(this);
        references.add(reference);
        reference.getEntries().add(new ResourceEntry(connection.getHostname(), ResourceType.SERVER));
        reference.getEntries().add(new ResourceEntry(connection.getDatabaseName(), ResourceType.DATABASENAME));
    }
    if (filename != null) {
        String realFilename = getRealFilename();
        if (reference == null) {
            reference = new ResourceReference(this);
            references.add(reference);
        }
        reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.FILE));
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 42 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryMysqlBulkFile method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if (connection != null) {
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(connection.getHostname(), ResourceType.SERVER));
        reference.getEntries().add(new ResourceEntry(connection.getDatabaseName(), ResourceType.DATABASENAME));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 43 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryMysqlBulkLoad method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    ResourceReference reference = null;
    if (connection != null) {
        reference = new ResourceReference(this);
        references.add(reference);
        reference.getEntries().add(new ResourceEntry(connection.getHostname(), ResourceType.SERVER));
        reference.getEntries().add(new ResourceEntry(connection.getDatabaseName(), ResourceType.DATABASENAME));
    }
    if (filename != null) {
        String realFilename = getRealFilename();
        if (reference == null) {
            reference = new ResourceReference(this);
            references.add(reference);
        }
        reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.FILE));
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 44 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryFileCompare method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if ((!Utils.isEmpty(filename1)) && (!Utils.isEmpty(filename2))) {
        String realFilename1 = jobMeta.environmentSubstitute(filename1);
        String realFilename2 = jobMeta.environmentSubstitute(filename2);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realFilename1, ResourceType.FILE));
        reference.getEntries().add(new ResourceEntry(realFilename2, ResourceType.FILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 45 with ResourceEntry

use of org.pentaho.di.resource.ResourceEntry in project pentaho-kettle by pentaho.

the class JobEntryFileExists method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if (!Utils.isEmpty(filename)) {
        String realFileName = jobMeta.environmentSubstitute(filename);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realFileName, ResourceType.FILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Aggregations

ResourceEntry (org.pentaho.di.resource.ResourceEntry)63 ResourceReference (org.pentaho.di.resource.ResourceReference)61 ArrayList (java.util.ArrayList)17 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)4 JobMeta (org.pentaho.di.job.JobMeta)4 Test (org.junit.Test)3 ResultFile (org.pentaho.di.core.ResultFile)2 Job (org.pentaho.di.job.Job)2 IExecutionData (org.pentaho.metaverse.api.model.IExecutionData)2 IExecutionProfile (org.pentaho.metaverse.api.model.IExecutionProfile)2 Throwables (com.google.common.base.Throwables)1 File (java.io.File)1 Serializable (java.io.Serializable)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Predicate (java.util.function.Predicate)1