Search in sources :

Example 51 with ResourceEntry

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

the class JobEntrySFTPPUT method getResourceDependencies.

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

Example 52 with ResourceEntry

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

the class JobEntrySQL 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 53 with ResourceEntry

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

the class JobEntryTelnet method getResourceDependencies.

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

Example 54 with ResourceEntry

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

the class JobEntryTrans method getResourceDependencies.

@Override
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if (!Utils.isEmpty(filename)) {
        // During this phase, the variable space hasn't been initialized yet - it seems
        // to happen during the execute. As such, we need to use the job meta's resolution
        // of the variables.
        String realFileName = jobMeta.environmentSubstitute(filename);
        ResourceReference reference = new ResourceReference(this);
        reference.getEntries().add(new ResourceEntry(realFileName, ResourceType.ACTIONFILE));
        references.add(reference);
    }
    return references;
}
Also used : ResourceEntry(org.pentaho.di.resource.ResourceEntry) ResourceReference(org.pentaho.di.resource.ResourceReference)

Example 55 with ResourceEntry

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

the class JobEntryDeleteFolders method getResourceDependencies.

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
    List<ResourceReference> references = super.getResourceDependencies(jobMeta);
    if (arguments != null) {
        ResourceReference reference = null;
        for (int i = 0; i < arguments.length; i++) {
            String filename = jobMeta.environmentSubstitute(arguments[i]);
            if (reference == null) {
                reference = new ResourceReference(this);
                references.add(reference);
            }
            reference.getEntries().add(new ResourceEntry(filename, ResourceType.FILE));
        }
    }
    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