use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class BaseStreamStepMetaTest method testGetResourceDependencies.
@Test
public void testGetResourceDependencies() {
String stepId = "KafkConsumerInput";
String path = "/home/bgroves/fake.ktr";
StepMeta stepMeta = new StepMeta();
stepMeta.setStepID(stepId);
StuffStreamMeta inputMeta = new StuffStreamMeta();
List<ResourceReference> resourceDependencies = inputMeta.getResourceDependencies(new TransMeta(), stepMeta);
assertEquals(0, resourceDependencies.get(0).getEntries().size());
inputMeta.setTransformationPath(path);
resourceDependencies = inputMeta.getResourceDependencies(new TransMeta(), stepMeta);
assertEquals(1, resourceDependencies.get(0).getEntries().size());
assertEquals(path, resourceDependencies.get(0).getEntries().get(0).getResource());
assertEquals(ResourceEntry.ResourceType.ACTIONFILE, resourceDependencies.get(0).getEntries().get(0).getResourcetype());
testRoundTrip(inputMeta);
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class JobEntryCheckDbConnections method getResourceDependencies.
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if (connections != null) {
for (int i = 0; i < connections.length; i++) {
DatabaseMeta connection = connections[i];
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;
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class ParGzipCsvInputMeta method getResourceDependencies.
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Utils.isEmpty(filename)) {
// Add the filename to the references, including a reference to this
// step meta data.
//
reference.getEntries().add(new ResourceEntry(transMeta.environmentSubstitute(filename), ResourceType.FILE));
}
return references;
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class SimpleMappingMeta method getResourceDependencies.
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
String realFilename = transMeta.environmentSubstitute(fileName);
String realTransname = transMeta.environmentSubstitute(transName);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Utils.isEmpty(realFilename)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.ACTIONFILE));
} else if (!Utils.isEmpty(realTransname)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realTransname, ResourceType.ACTIONFILE));
references.add(reference);
}
return references;
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class SingleThreaderMeta method getResourceDependencies.
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
String realFilename = transMeta.environmentSubstitute(fileName);
String realTransname = transMeta.environmentSubstitute(transName);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Utils.isEmpty(realFilename)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.ACTIONFILE));
} else if (!Utils.isEmpty(realTransname)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realTransname, ResourceType.ACTIONFILE));
references.add(reference);
}
return references;
}
Aggregations