NIFI-1573 Allow programmatic access to a Processor's name

This commit is contained in:
Richard Miskin 2016-02-27 15:18:22 +00:00
parent 58e50ae39d
commit 738236a41d
6 changed files with 30 additions and 0 deletions

View File

@ -160,4 +160,9 @@ public interface ProcessContext {
* @return the StateManager that can be used to store and retrieve state for this component
*/
StateManager getStateManager();
/**
* @return the configured name of this processor
*/
String getName();
}

View File

@ -355,4 +355,9 @@ public class MockProcessContext extends MockControllerServiceLookup implements S
public StateManager getStateManager() {
return stateManager;
}
@Override
public String getName() {
return "";
}
}

View File

@ -108,4 +108,9 @@ public class MockProcessContext implements ProcessContext {
public StateManager getStateManager() {
return null;
}
@Override
public String getName() {
return null;
}
}

View File

@ -243,4 +243,9 @@ public class ConnectableProcessContext implements ProcessContext {
public StateManager getStateManager() {
return stateManager;
}
@Override
public String getName() {
return connectable.getName();
}
}

View File

@ -216,4 +216,9 @@ public class StandardProcessContext implements ProcessContext, ControllerService
public StateManager getStateManager() {
return stateManager;
}
@Override
public String getName() {
return procNode.getName();
}
}

View File

@ -147,4 +147,9 @@ public class StandardSchedulingContext implements SchedulingContext {
public StateManager getStateManager() {
return stateManager;
}
@Override
public String getName() {
return processorNode.getName();
}
}