NIFI-271 more cleanup

This commit is contained in:
joewitt 2015-04-22 23:42:19 -04:00
parent 7f9dff52b0
commit a53cc3d707
58 changed files with 1015 additions and 1118 deletions

View File

@ -372,6 +372,9 @@
<profiles> <profiles>
<profile> <!-- will move this up with the always on plugins once we get all checkstyle stuff resolved--> <profile> <!-- will move this up with the always on plugins once we get all checkstyle stuff resolved-->
<id>checkstyle</id> <id>checkstyle</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

View File

@ -138,11 +138,6 @@ public class JettyServer implements NiFiServer {
loadWars(locateNarWorkingDirectories()); loadWars(locateNarWorkingDirectories());
} }
/**
* Locates the working directory for each NAR.
*
* @return
*/
private Set<File> locateNarWorkingDirectories() { private Set<File> locateNarWorkingDirectories() {
final File frameworkWorkingDir = props.getFrameworkWorkingDirectory(); final File frameworkWorkingDir = props.getFrameworkWorkingDirectory();
final File extensionsWorkingDir = props.getExtensionsWorkingDirectory(); final File extensionsWorkingDir = props.getExtensionsWorkingDirectory();
@ -168,7 +163,7 @@ public class JettyServer implements NiFiServer {
* Loads the WARs in the specified NAR working directories. A WAR file must * Loads the WARs in the specified NAR working directories. A WAR file must
* have a ".war" extension. * have a ".war" extension.
* *
* @param warDir a directory containing WARs to load * @param narWorkingDirectories dirs
*/ */
private void loadWars(final Set<File> narWorkingDirectories) { private void loadWars(final Set<File> narWorkingDirectories) {
@ -348,12 +343,6 @@ public class JettyServer implements NiFiServer {
server.setHandler(handlers); server.setHandler(handlers);
} }
/**
* Finds WAR files in the specified NAR working directories.
*
* @param narWorkingDirectories
* @return
*/
private Map<File, File> findWars(final Set<File> narWorkingDirectories) { private Map<File, File> findWars(final Set<File> narWorkingDirectories) {
final Map<File, File> wars = new HashMap<>(); final Map<File, File> wars = new HashMap<>();
@ -408,8 +397,8 @@ public class JettyServer implements NiFiServer {
/** /**
* Identifies all known UI extensions and stores them in the specified map. * Identifies all known UI extensions and stores them in the specified map.
* *
* @param uiExtensions * @param uiExtensions extensions
* @param warFile * @param warFile war
*/ */
private void identifyUiExtensionsForComponents(final Map<UiExtensionType, List<String>> uiExtensions, final File warFile) { private void identifyUiExtensionsForComponents(final Map<UiExtensionType, List<String>> uiExtensions, final File warFile) {
try (final JarFile jarFile = new JarFile(warFile)) { try (final JarFile jarFile = new JarFile(warFile)) {
@ -424,10 +413,11 @@ public class JettyServer implements NiFiServer {
} }
/** /**
* Extracts the component type. Trims the line and considers comments. Returns null if no type was found. * Extracts the component type. Trims the line and considers comments.
* Returns null if no type was found.
* *
* @param line * @param line line
* @return * @return type
*/ */
private String extractComponentType(final String line) { private String extractComponentType(final String line) {
final String trimmedLine = line.trim(); final String trimmedLine = line.trim();
@ -441,8 +431,9 @@ public class JettyServer implements NiFiServer {
/** /**
* Returns the extension in the specified WAR using the specified path. * Returns the extension in the specified WAR using the specified path.
* *
* @param war * @param war war
* @return * @param path path
* @return extensions
*/ */
private List<String> getWarExtensions(final File war, final String path) { private List<String> getWarExtensions(final File war, final String path) {
List<String> processorTypes = new ArrayList<>(); List<String> processorTypes = new ArrayList<>();
@ -660,9 +651,6 @@ public class JettyServer implements NiFiServer {
return contextFactory; return contextFactory;
} }
/**
* Starts the web server.
*/
@Override @Override
public void start() { public void start() {
try { try {
@ -683,7 +671,7 @@ public class JettyServer implements NiFiServer {
} }
} }
// ensure the appropriate wars deployed successfully before injecting the NiFi context and security filters - // ensure the appropriate wars deployed successfully before injecting the NiFi context and security filters
// this must be done after starting the server (and ensuring there were no start up failures) // this must be done after starting the server (and ensuring there were no start up failures)
if (webApiContext != null) { if (webApiContext != null) {
// give the web api the component ui extensions // give the web api the component ui extensions
@ -799,11 +787,6 @@ public class JettyServer implements NiFiServer {
} }
} }
/**
* Dump each applicable url.
*
* @throws SocketException
*/
private void dumpUrls() throws SocketException { private void dumpUrls() throws SocketException {
final List<String> urls = new ArrayList<>(); final List<String> urls = new ArrayList<>();
@ -853,11 +836,6 @@ public class JettyServer implements NiFiServer {
} }
} }
/**
* Handles when a start up failure occurs.
*
* @param t
*/
private void startUpFailure(Throwable t) { private void startUpFailure(Throwable t) {
System.err.println("Failed to start web server: " + t.getMessage()); System.err.println("Failed to start web server: " + t.getMessage());
System.err.println("Shutting down..."); System.err.println("Shutting down...");
@ -870,9 +848,6 @@ public class JettyServer implements NiFiServer {
this.extensionMapping = extensionMapping; this.extensionMapping = extensionMapping;
} }
/**
* Stops the web server.
*/
@Override @Override
public void stop() { public void stop() {
try { try {

View File

@ -32,18 +32,14 @@ public class UiExtension {
} }
/** /**
* The type of this UI extension. * @return type of this UI extension
*
* @return
*/ */
public UiExtensionType getExtensionType() { public UiExtensionType getExtensionType() {
return extensionType; return extensionType;
} }
/** /**
* The context path of this UI extenion. * @return The context path of this UI extension
*
* @return
*/ */
public String getContextPath() { public String getContextPath() {
return contextPath; return contextPath;

View File

@ -31,19 +31,18 @@ public class UiExtensionMapping {
} }
/** /**
* Returns whether there are any UI extensions for the specified component type. * @param type type
* * @return whether there are any UI extensions for the specified component
* @param type * type
* @return
*/ */
public boolean hasUiExtension(final String type) { public boolean hasUiExtension(final String type) {
return uiExtensions.containsKey(type); return uiExtensions.containsKey(type);
} }
/** /**
* Gets the listing of all discovered UI extensions for the specified component type. * @param type type
* @param type * @return the listing of all discovered UI extensions for the specified
* @return * component type
*/ */
public List<UiExtension> getUiExtension(final String type) { public List<UiExtension> getUiExtension(final String type) {
return uiExtensions.get(type); return uiExtensions.get(type);

View File

@ -464,7 +464,8 @@ public class ControllerServiceAuditor extends NiFiAuditor {
} }
/** /**
* Returns whether the specified controller service is disabled (or disabling). * Returns whether the specified controller service is disabled (or
* disabling).
* *
* @param controllerService * @param controllerService
* @return * @return

View File

@ -297,7 +297,8 @@ public class ReportingTaskAuditor extends NiFiAuditor {
} }
/** /**
* Extracts the values for the configured properties from the specified ReportingTask. * Extracts the values for the configured properties from the specified
* ReportingTask.
* *
* @param reportingTask * @param reportingTask
* @param reportingTaskDTO * @param reportingTaskDTO

View File

@ -211,7 +211,6 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
// ----------------------------------------- // -----------------------------------------
// Verification Operations // Verification Operations
// ----------------------------------------- // -----------------------------------------
@Override @Override
public void verifyCreateConnection(String groupId, ConnectionDTO connectionDTO) { public void verifyCreateConnection(String groupId, ConnectionDTO connectionDTO) {
connectionDAO.verifyCreate(groupId, connectionDTO); connectionDAO.verifyCreate(groupId, connectionDTO);
@ -365,7 +364,6 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
// ----------------------------------------- // -----------------------------------------
// Write Operations // Write Operations
// ----------------------------------------- // -----------------------------------------
@Override @Override
public ConfigurationSnapshot<ConnectionDTO> updateConnection(final Revision revision, final String groupId, final ConnectionDTO connectionDTO) { public ConfigurationSnapshot<ConnectionDTO> updateConnection(final Revision revision, final String groupId, final ConnectionDTO connectionDTO) {
// if connection does not exist, then create new connection // if connection does not exist, then create new connection
@ -1488,7 +1486,6 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
// ----------------------------------------- // -----------------------------------------
// Read Operations // Read Operations
// ----------------------------------------- // -----------------------------------------
@Override @Override
public RevisionDTO getRevision() { public RevisionDTO getRevision() {
return dtoFactory.createRevisionDTO(optimisticLockingManager.getLastModification()); return dtoFactory.createRevisionDTO(optimisticLockingManager.getLastModification());

View File

@ -68,8 +68,8 @@ import org.apache.nifi.web.api.entity.ReportingTaskEntity;
import org.apache.nifi.web.util.ClientResponseUtils; import org.apache.nifi.web.util.ClientResponseUtils;
/** /**
* Implements the NiFiWebConfigurationContext interface to support a context in both * Implements the NiFiWebConfigurationContext interface to support a context in
* standalone and clustered environments. * both standalone and clustered environments.
*/ */
public class StandardNiFiWebConfigurationContext implements NiFiWebConfigurationContext { public class StandardNiFiWebConfigurationContext implements NiFiWebConfigurationContext {
@ -255,6 +255,7 @@ public class StandardNiFiWebConfigurationContext implements NiFiWebConfiguration
* Facade over accessing different types of NiFi components. * Facade over accessing different types of NiFi components.
*/ */
private interface ComponentFacade { private interface ComponentFacade {
/** /**
* Gets the component details using the specified request context. * Gets the component details using the specified request context.
* *
@ -277,6 +278,7 @@ public class StandardNiFiWebConfigurationContext implements NiFiWebConfiguration
* Interprets the request/response with the underlying Processor model. * Interprets the request/response with the underlying Processor model.
*/ */
private class ProcessorFacade implements ComponentFacade { private class ProcessorFacade implements ComponentFacade {
@Override @Override
public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) { public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) {
final String id = requestContext.getId(); final String id = requestContext.getId();
@ -390,9 +392,11 @@ public class StandardNiFiWebConfigurationContext implements NiFiWebConfiguration
} }
/** /**
* Interprets the request/response with the underlying ControllerService model. * Interprets the request/response with the underlying ControllerService
* model.
*/ */
private class ControllerServiceFacade implements ComponentFacade { private class ControllerServiceFacade implements ComponentFacade {
@Override @Override
public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) { public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) {
final String id = requestContext.getId(); final String id = requestContext.getId();
@ -524,9 +528,11 @@ public class StandardNiFiWebConfigurationContext implements NiFiWebConfiguration
} }
/** /**
* Interprets the request/response with the underlying ControllerService model. * Interprets the request/response with the underlying ControllerService
* model.
*/ */
private class ReportingTaskFacade implements ComponentFacade { private class ReportingTaskFacade implements ComponentFacade {
@Override @Override
public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) { public ComponentDetails getComponentDetails(final NiFiWebRequestContext requestContext) {
final String id = requestContext.getId(); final String id = requestContext.getId();

View File

@ -288,8 +288,8 @@ public class StandardNiFiWebContext implements NiFiWebContext {
* Gets the headers for the request to replicate to each node while * Gets the headers for the request to replicate to each node while
* clustered. * clustered.
* *
* @param config * @param config config
* @return * @return headers
*/ */
private Map<String, String> getHeaders(final NiFiWebContextConfig config) { private Map<String, String> getHeaders(final NiFiWebContextConfig config) {
final Map<String, String> headers = new HashMap<>(); final Map<String, String> headers = new HashMap<>();

View File

@ -121,8 +121,8 @@ public class ControllerServiceResource extends ApplicationResource {
} }
/** /**
* Parses the availability and ensure that the specified availability makes sense for the * Parses the availability and ensure that the specified availability makes
* given NiFi instance. * sense for the given NiFi instance.
* *
* @param availability * @param availability
* @return * @return
@ -149,8 +149,9 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @return A controllerServicesEntity. * @return A controllerServicesEntity.
*/ */
@GET @GET
@ -191,8 +192,9 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param type The type of controller service to create. * @param type The type of controller service to create.
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
*/ */
@ -232,8 +234,9 @@ public class ControllerServiceResource extends ApplicationResource {
* Creates a new Controller Service. * Creates a new Controller Service.
* *
* @param httpServletRequest * @param httpServletRequest
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param controllerServiceEntity A controllerServiceEntity. * @param controllerServiceEntity A controllerServiceEntity.
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
*/ */
@ -324,8 +327,9 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to retrieve * @param id The id of the controller service to retrieve
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
*/ */
@ -414,8 +418,9 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to retrieve * @param id The id of the controller service to retrieve
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
*/ */
@ -459,12 +464,14 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to retrieve * @param id The id of the controller service to retrieve
* @param state Sets the state of referencing components. A value of RUNNING or STOPPED will update * @param state Sets the state of referencing components. A value of RUNNING
* referencing schedulable components (Processors and Reporting Tasks). A value of ENABLED or * or STOPPED will update referencing schedulable components (Processors and
* DISABLED will update referencing controller services. * Reporting Tasks). A value of ENABLED or DISABLED will update referencing
* controller services.
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
*/ */
@PUT @PUT
@ -481,7 +488,6 @@ public class ControllerServiceResource extends ApplicationResource {
@FormParam("state") @DefaultValue(StringUtils.EMPTY) String state) { @FormParam("state") @DefaultValue(StringUtils.EMPTY) String state) {
// parse the state to determine the desired action // parse the state to determine the desired action
// need to consider controller service state first as it shares a state with // need to consider controller service state first as it shares a state with
// scheduled state (disabled) which is applicable for referencing services // scheduled state (disabled) which is applicable for referencing services
// but not referencing schedulable components // but not referencing schedulable components
@ -533,8 +539,8 @@ public class ControllerServiceResource extends ApplicationResource {
} }
// get the controller service // get the controller service
final ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> response = final ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> response
serviceFacade.updateControllerServiceReferencingComponents(new Revision(clientVersion, clientId.getClientId()), id, scheduledState, controllerServiceState); = serviceFacade.updateControllerServiceReferencingComponents(new Revision(clientVersion, clientId.getClientId()), id, scheduledState, controllerServiceState);
// create the revision // create the revision
final RevisionDTO revision = new RevisionDTO(); final RevisionDTO revision = new RevisionDTO();
@ -558,14 +564,17 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to update. * @param id The id of the controller service to update.
* @param name The name of the controller service * @param name The name of the controller service
* @param annotationData The annotation data for the controller service * @param annotationData The annotation data for the controller service
* @param comments The comments for the controller service * @param comments The comments for the controller service
* @param state The state of this controller service. Should be ENABLED or DISABLED. * @param state The state of this controller service. Should be ENABLED or
* @param markedForDeletion Array of property names whose value should be removed. * DISABLED.
* @param markedForDeletion Array of property names whose value should be
* removed.
* @param formParams Additionally, the processor properties and styles are * @param formParams Additionally, the processor properties and styles are
* specified in the form parameters. Because the property names and styles * specified in the form parameters. Because the property names and styles
* differ from processor to processor they are specified in a map-like * differ from processor to processor they are specified in a map-like
@ -654,8 +663,9 @@ public class ControllerServiceResource extends ApplicationResource {
* Updates the specified a new Controller Service. * Updates the specified a new Controller Service.
* *
* @param httpServletRequest * @param httpServletRequest
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to update. * @param id The id of the controller service to update.
* @param controllerServiceEntity A controllerServiceEntity. * @param controllerServiceEntity A controllerServiceEntity.
* @return A controllerServiceEntity. * @return A controllerServiceEntity.
@ -736,8 +746,9 @@ public class ControllerServiceResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the controller service is available on the NCM only (ncm) or on the * @param availability Whether the controller service is available on the
* nodes only (node). If this instance is not clustered all services should use the node availability. * NCM only (ncm) or on the nodes only (node). If this instance is not
* clustered all services should use the node availability.
* @param id The id of the controller service to remove. * @param id The id of the controller service to remove.
* @return A entity containing the client id and an updated revision. * @return A entity containing the client id and an updated revision.
*/ */
@ -788,7 +799,6 @@ public class ControllerServiceResource extends ApplicationResource {
} }
// setters // setters
public void setServiceFacade(NiFiServiceFacade serviceFacade) { public void setServiceFacade(NiFiServiceFacade serviceFacade) {
this.serviceFacade = serviceFacade; this.serviceFacade = serviceFacade;
} }

View File

@ -72,6 +72,7 @@ public class FunnelResource extends ApplicationResource {
/** /**
* Populates the uri for the specified funnels. * Populates the uri for the specified funnels.
*
* @param funnels * @param funnels
* @return * @return
*/ */

View File

@ -74,6 +74,7 @@ public class InputPortResource extends ApplicationResource {
/** /**
* Populates the uri for the specified input ports. * Populates the uri for the specified input ports.
*
* @param inputPorts * @param inputPorts
* @return * @return
*/ */

View File

@ -74,6 +74,7 @@ public class LabelResource extends ApplicationResource {
/** /**
* Populates the uri for the specified labels. * Populates the uri for the specified labels.
*
* @param labels * @param labels
* @return * @return
*/ */

View File

@ -74,6 +74,7 @@ public class OutputPortResource extends ApplicationResource {
/** /**
* Populates the uri for the specified output ports. * Populates the uri for the specified output ports.
*
* @param outputPorts * @param outputPorts
* @return * @return
*/ */

View File

@ -117,8 +117,8 @@ public class ReportingTaskResource extends ApplicationResource {
} }
/** /**
* Parses the availability and ensure that the specified availability makes sense for the * Parses the availability and ensure that the specified availability makes
* given NiFi instance. * sense for the given NiFi instance.
* *
* @param availability * @param availability
* @return * @return
@ -145,8 +145,9 @@ public class ReportingTaskResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @return A reportingTasksEntity. * @return A reportingTasksEntity.
*/ */
@GET @GET
@ -187,8 +188,9 @@ public class ReportingTaskResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param type The type of reporting task to create. * @param type The type of reporting task to create.
* @return A reportingTaskEntity. * @return A reportingTaskEntity.
*/ */
@ -228,8 +230,9 @@ public class ReportingTaskResource extends ApplicationResource {
* Creates a new Reporting Task. * Creates a new Reporting Task.
* *
* @param httpServletRequest * @param httpServletRequest
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param reportingTaskEntity A reportingTaskEntity. * @param reportingTaskEntity A reportingTaskEntity.
* @return A reportingTaskEntity. * @return A reportingTaskEntity.
*/ */
@ -320,8 +323,9 @@ public class ReportingTaskResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param id The id of the reporting task to retrieve * @param id The id of the reporting task to retrieve
* @return A reportingTaskEntity. * @return A reportingTaskEntity.
*/ */
@ -413,12 +417,14 @@ public class ReportingTaskResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param id The id of the reporting task to update. * @param id The id of the reporting task to update.
* @param name The name of the reporting task * @param name The name of the reporting task
* @param annotationData The annotation data for the reporting task * @param annotationData The annotation data for the reporting task
* @param markedForDeletion Array of property names whose value should be removed. * @param markedForDeletion Array of property names whose value should be
* removed.
* @param state The updated scheduled state * @param state The updated scheduled state
* @param schedulingStrategy The scheduling strategy for this reporting task * @param schedulingStrategy The scheduling strategy for this reporting task
* @param schedulingPeriod The scheduling period for this reporting task * @param schedulingPeriod The scheduling period for this reporting task
@ -514,8 +520,9 @@ public class ReportingTaskResource extends ApplicationResource {
* Updates the specified a Reporting Task. * Updates the specified a Reporting Task.
* *
* @param httpServletRequest * @param httpServletRequest
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param id The id of the reporting task to update. * @param id The id of the reporting task to update.
* @param reportingTaskEntity A reportingTaskEntity. * @param reportingTaskEntity A reportingTaskEntity.
* @return A reportingTaskEntity. * @return A reportingTaskEntity.
@ -596,8 +603,9 @@ public class ReportingTaskResource extends ApplicationResource {
* @param clientId Optional client id. If the client id is not specified, a * @param clientId Optional client id. If the client id is not specified, a
* new one will be generated. This value (whether specified or generated) is * new one will be generated. This value (whether specified or generated) is
* included in the response. * included in the response.
* @param availability Whether the reporting task is available on the NCM only (ncm) or on the * @param availability Whether the reporting task is available on the NCM
* nodes only (node). If this instance is not clustered all tasks should use the node availability. * only (ncm) or on the nodes only (node). If this instance is not clustered
* all tasks should use the node availability.
* @param id The id of the reporting task to remove. * @param id The id of the reporting task to remove.
* @return A entity containing the client id and an updated revision. * @return A entity containing the client id and an updated revision.
*/ */
@ -648,7 +656,6 @@ public class ReportingTaskResource extends ApplicationResource {
} }
// setters // setters
public void setServiceFacade(NiFiServiceFacade serviceFacade) { public void setServiceFacade(NiFiServiceFacade serviceFacade) {
this.serviceFacade = serviceFacade; this.serviceFacade = serviceFacade;
} }

View File

@ -71,6 +71,7 @@ public class TemplateResource extends ApplicationResource {
/** /**
* Populates the uri for the specified templates. * Populates the uri for the specified templates.
*
* @param templates * @param templates
* @return * @return
*/ */

View File

@ -1328,8 +1328,8 @@ public final class DtoFactory {
return capabilityDesc.value(); return capabilityDesc.value();
} }
final org.apache.nifi.processor.annotation.CapabilityDescription deprecatedCapabilityDesc = final org.apache.nifi.processor.annotation.CapabilityDescription deprecatedCapabilityDesc
cls.getAnnotation(org.apache.nifi.processor.annotation.CapabilityDescription.class); = cls.getAnnotation(org.apache.nifi.processor.annotation.CapabilityDescription.class);
return (deprecatedCapabilityDesc == null) ? null : deprecatedCapabilityDesc.value(); return (deprecatedCapabilityDesc == null) ? null : deprecatedCapabilityDesc.value();
} }
@ -1883,7 +1883,6 @@ public final class DtoFactory {
return copy; return copy;
} }
public ControllerServiceDTO copy(final ControllerServiceDTO original) { public ControllerServiceDTO copy(final ControllerServiceDTO original) {
final ControllerServiceDTO copy = new ControllerServiceDTO(); final ControllerServiceDTO copy = new ControllerServiceDTO();
copy.setAnnotationData(original.getAnnotationData()); copy.setAnnotationData(original.getAnnotationData());
@ -2409,7 +2408,6 @@ public final class DtoFactory {
} }
/* setters */ /* setters */
public void setControllerServiceLookup(ControllerServiceLookup lookup) { public void setControllerServiceLookup(ControllerServiceLookup lookup) {
this.controllerServiceLookup = lookup; this.controllerServiceLookup = lookup;
} }

View File

@ -39,7 +39,6 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
* clustered environment. In this case, the cluster manager is created and * clustered environment. In this case, the cluster manager is created and
* managed. * managed.
* *
* @author unattributed
*/ */
public class ApplicationStartupContextListener implements ServletContextListener { public class ApplicationStartupContextListener implements ServletContextListener {

View File

@ -413,6 +413,7 @@ public class ControllerFacade {
/** /**
* Resets the counter with the specified id. * Resets the counter with the specified id.
*
* @param id * @param id
* @return * @return
*/ */

View File

@ -20,15 +20,12 @@ import java.util.Set;
import org.apache.nifi.connectable.Connection; import org.apache.nifi.connectable.Connection;
import org.apache.nifi.web.api.dto.ConnectionDTO; import org.apache.nifi.web.api.dto.ConnectionDTO;
/**
*
*/
public interface ConnectionDAO { public interface ConnectionDAO {
/** /**
* Gets the specified Connection. * Gets the specified Connection.
* *
* @param groupId * @param groupId group id
* @param id The connection id * @param id The connection id
* @return The connection * @return The connection
*/ */
@ -37,25 +34,25 @@ public interface ConnectionDAO {
/** /**
* Gets the connections for the specified source processor. * Gets the connections for the specified source processor.
* *
* @param groupId * @param groupId group id
* @param processorId * @param processorId processor id
* @return * @return connections
*/ */
Set<Connection> getConnectionsForSource(String groupId, String processorId); Set<Connection> getConnectionsForSource(String groupId, String processorId);
/** /**
* Determines if the specified connection exists. * Determines if the specified connection exists.
* *
* @param groupId * @param groupId group id
* @param id * @param id id
* @return * @return true if connection exists
*/ */
boolean hasConnection(String groupId, String id); boolean hasConnection(String groupId, String id);
/** /**
* Gets all of the connections. * Gets all of the connections.
* *
* @param groupId * @param groupId group identifier
* @return The connections * @return The connections
*/ */
Set<Connection> getConnections(String groupId); Set<Connection> getConnections(String groupId);
@ -63,7 +60,7 @@ public interface ConnectionDAO {
/** /**
* Creates a new Connection. * Creates a new Connection.
* *
* @param groupId * @param groupId group id
* @param connectionDTO The connection DTO * @param connectionDTO The connection DTO
* @return The connection * @return The connection
*/ */
@ -72,23 +69,23 @@ public interface ConnectionDAO {
/** /**
* Verifies the create request can be processed. * Verifies the create request can be processed.
* *
* @param groupId * @param groupId group id
* @param connectionDTO * @param connectionDTO connection
*/ */
void verifyCreate(String groupId, ConnectionDTO connectionDTO); void verifyCreate(String groupId, ConnectionDTO connectionDTO);
/** /**
* Verifies the update request can be processed. * Verifies the update request can be processed.
* *
* @param groupId * @param groupId group id
* @param connectionDTO * @param connectionDTO connection
*/ */
void verifyUpdate(String groupId, ConnectionDTO connectionDTO); void verifyUpdate(String groupId, ConnectionDTO connectionDTO);
/** /**
* Updates the specified Connection. * Updates the specified Connection.
* *
* @param groupId * @param groupId group id
* @param connectionDTO The connection DTO * @param connectionDTO The connection DTO
* @return The connection * @return The connection
*/ */
@ -97,15 +94,15 @@ public interface ConnectionDAO {
/** /**
* Verifies the delete request can be processed. * Verifies the delete request can be processed.
* *
* @param groupId * @param groupId group id
* @param id * @param id id
*/ */
void verifyDelete(String groupId, String id); void verifyDelete(String groupId, String id);
/** /**
* Deletes the specified Connection. * Deletes the specified Connection.
* *
* @param groupId * @param groupId group id
* @param id The id of the connection * @param id The id of the connection
*/ */
void deleteConnection(String groupId, String id); void deleteConnection(String groupId, String id);

View File

@ -24,16 +24,11 @@ import org.apache.nifi.controller.service.ControllerServiceReference;
import org.apache.nifi.controller.service.ControllerServiceState; import org.apache.nifi.controller.service.ControllerServiceState;
import org.apache.nifi.web.api.dto.ControllerServiceDTO; import org.apache.nifi.web.api.dto.ControllerServiceDTO;
/**
*
*/
public interface ControllerServiceDAO { public interface ControllerServiceDAO {
/** /**
* Determines if the specified controller service exists. * @param controllerServiceId service id
* * @return Determines if the specified controller service exists
* @param controllerServiceId
* @return
*/ */
boolean hasControllerService(String controllerServiceId); boolean hasControllerService(String controllerServiceId);
@ -71,8 +66,8 @@ public interface ControllerServiceDAO {
/** /**
* Updates the referencing components for the specified controller service. * Updates the referencing components for the specified controller service.
* *
* @param controllerServiceId * @param controllerServiceId service id
* @param scheduledState * @param scheduledState scheduled state
* @param controllerServiceState the value of state * @param controllerServiceState the value of state
* @return the org.apache.nifi.controller.service.ControllerServiceReference * @return the org.apache.nifi.controller.service.ControllerServiceReference
*/ */
@ -81,23 +76,24 @@ public interface ControllerServiceDAO {
/** /**
* Determines whether this controller service can be updated. * Determines whether this controller service can be updated.
* *
* @param controllerServiceDTO * @param controllerServiceDTO service
*/ */
void verifyUpdate(ControllerServiceDTO controllerServiceDTO); void verifyUpdate(ControllerServiceDTO controllerServiceDTO);
/** /**
* Determines whether the referencing component of the specified controller service can be updated. * Determines whether the referencing component of the specified controller
* service can be updated.
* *
* @param controllerServiceId * @param controllerServiceId service id
* @param scheduledState * @param scheduledState scheduled state
* @param controllerServiceState * @param controllerServiceState service state
*/ */
void verifyUpdateReferencingComponents(String controllerServiceId, ScheduledState scheduledState, ControllerServiceState controllerServiceState); void verifyUpdateReferencingComponents(String controllerServiceId, ScheduledState scheduledState, ControllerServiceState controllerServiceState);
/** /**
* Determines whether this controller service can be removed. * Determines whether this controller service can be removed.
* *
* @param controllerServiceId * @param controllerServiceId service id
*/ */
void verifyDelete(String controllerServiceId); void verifyDelete(String controllerServiceId);

View File

@ -21,24 +21,19 @@ import java.util.Set;
import org.apache.nifi.connectable.Funnel; import org.apache.nifi.connectable.Funnel;
import org.apache.nifi.web.api.dto.FunnelDTO; import org.apache.nifi.web.api.dto.FunnelDTO;
/**
*
*/
public interface FunnelDAO { public interface FunnelDAO {
/** /**
* Determines if the specified funnel exists in the specified group. * @param groupId group id
* * @param funnelId funnel id
* @param groupId * @return Determines if the specified funnel exists in the specified group
* @param funnelId
* @return
*/ */
boolean hasFunnel(String groupId, String funnelId); boolean hasFunnel(String groupId, String funnelId);
/** /**
* Creates a funnel in the specified group. * Creates a funnel in the specified group.
* *
* @param groupId * @param groupId group id
* @param funnelDTO The funnel DTO * @param funnelDTO The funnel DTO
* @return The funnel * @return The funnel
*/ */
@ -47,7 +42,7 @@ public interface FunnelDAO {
/** /**
* Gets the specified funnel in the specified group. * Gets the specified funnel in the specified group.
* *
* @param groupId * @param groupId group id
* @param funnelId The funnel id * @param funnelId The funnel id
* @return The funnel * @return The funnel
*/ */
@ -56,7 +51,7 @@ public interface FunnelDAO {
/** /**
* Gets all of the funnels in the specified group. * Gets all of the funnels in the specified group.
* *
* @param groupId * @param groupId group id
* @return The funnels * @return The funnels
*/ */
Set<Funnel> getFunnels(String groupId); Set<Funnel> getFunnels(String groupId);
@ -64,7 +59,7 @@ public interface FunnelDAO {
/** /**
* Updates the specified funnel in the specified group. * Updates the specified funnel in the specified group.
* *
* @param groupId * @param groupId group id
* @param funnelDTO The funnel DTO * @param funnelDTO The funnel DTO
* @return The funnel * @return The funnel
*/ */
@ -73,15 +68,15 @@ public interface FunnelDAO {
/** /**
* Determines whether this funnel can be removed. * Determines whether this funnel can be removed.
* *
* @param groupId * @param groupId group id
* @param funnelId * @param funnelId funnel id
*/ */
void verifyDelete(String groupId, String funnelId); void verifyDelete(String groupId, String funnelId);
/** /**
* Deletes the specified Funnel in the specified group. * Deletes the specified Funnel in the specified group.
* *
* @param groupId * @param groupId group id
* @param funnelId The funnel id * @param funnelId The funnel id
*/ */
void deleteFunnel(String groupId, String funnelId); void deleteFunnel(String groupId, String funnelId);

View File

@ -20,24 +20,19 @@ import java.util.Set;
import org.apache.nifi.controller.label.Label; import org.apache.nifi.controller.label.Label;
import org.apache.nifi.web.api.dto.LabelDTO; import org.apache.nifi.web.api.dto.LabelDTO;
/**
*
*/
public interface LabelDAO { public interface LabelDAO {
/** /**
* Determines if the specified label exists in the specified group. * @param groupId group id
* * @param labelId label id
* @param groupId * @return Determines if the specified label exists in the specified group
* @param labelId
* @return
*/ */
boolean hasLabel(String groupId, String labelId); boolean hasLabel(String groupId, String labelId);
/** /**
* Creates a label in the specified group. * Creates a label in the specified group.
* *
* @param groupId * @param groupId group id
* @param labelDTO The label DTO * @param labelDTO The label DTO
* @return The label * @return The label
*/ */
@ -46,7 +41,7 @@ public interface LabelDAO {
/** /**
* Gets the specified label in the specified group. * Gets the specified label in the specified group.
* *
* @param groupId * @param groupId group id
* @param labelId The label id * @param labelId The label id
* @return The label * @return The label
*/ */
@ -55,7 +50,7 @@ public interface LabelDAO {
/** /**
* Gets all of the labels in the specified group. * Gets all of the labels in the specified group.
* *
* @param groupId * @param groupId group id
* @return The labels * @return The labels
*/ */
Set<Label> getLabels(String groupId); Set<Label> getLabels(String groupId);
@ -63,7 +58,7 @@ public interface LabelDAO {
/** /**
* Updates the specified label in the specified group. * Updates the specified label in the specified group.
* *
* @param groupId * @param groupId group id
* @param labelDTO The label DTO * @param labelDTO The label DTO
* @return The label * @return The label
*/ */
@ -72,7 +67,7 @@ public interface LabelDAO {
/** /**
* Deletes the specified label in the specified group. * Deletes the specified label in the specified group.
* *
* @param groupId * @param groupId group id
* @param labelId The label id * @param labelId The label id
*/ */
void deleteLabel(String groupId, String labelId); void deleteLabel(String groupId, String labelId);

View File

@ -21,24 +21,19 @@ import java.util.Set;
import org.apache.nifi.connectable.Port; import org.apache.nifi.connectable.Port;
import org.apache.nifi.web.api.dto.PortDTO; import org.apache.nifi.web.api.dto.PortDTO;
/**
*
*/
public interface PortDAO { public interface PortDAO {
/** /**
* Determines if the specified port exists in the specified group. * @param groupId group id
* * @param portId port id
* @param groupId * @return Determines if the specified port exists in the specified group
* @param portId
* @return
*/ */
boolean hasPort(String groupId, String portId); boolean hasPort(String groupId, String portId);
/** /**
* Creates a port in the specified group. * Creates a port in the specified group.
* *
* @param groupId * @param groupId group id
* @param portDTO The port DTO * @param portDTO The port DTO
* @return The port * @return The port
*/ */
@ -47,7 +42,7 @@ public interface PortDAO {
/** /**
* Gets the specified port in the specified group. * Gets the specified port in the specified group.
* *
* @param groupId * @param groupId group id
* @param portId The port id * @param portId The port id
* @return The port * @return The port
*/ */
@ -56,7 +51,7 @@ public interface PortDAO {
/** /**
* Gets all of the ports in the specified group. * Gets all of the ports in the specified group.
* *
* @param groupId * @param groupId group id
* @return The ports * @return The ports
*/ */
Set<Port> getPorts(String groupId); Set<Port> getPorts(String groupId);
@ -64,15 +59,15 @@ public interface PortDAO {
/** /**
* Verifies the specified port can be updated per the specified request. * Verifies the specified port can be updated per the specified request.
* *
* @param groupId * @param groupId group id
* @param portDTO * @param portDTO port
*/ */
void verifyUpdate(String groupId, PortDTO portDTO); void verifyUpdate(String groupId, PortDTO portDTO);
/** /**
* Updates the specified port in the specified group. * Updates the specified port in the specified group.
* *
* @param groupId * @param groupId group
* @param portDTO The port DTO * @param portDTO The port DTO
* @return The port * @return The port
*/ */
@ -81,15 +76,15 @@ public interface PortDAO {
/** /**
* Verifies the specified port can be removed. * Verifies the specified port can be removed.
* *
* @param groupId * @param groupId group id
* @param portId * @param portId port id
*/ */
void verifyDelete(String groupId, String portId); void verifyDelete(String groupId, String portId);
/** /**
* Deletes the specified label in the specified group. * Deletes the specified label in the specified group.
* *
* @param groupId * @param groupId group id
* @param portId The port id * @param portId The port id
*/ */
void deletePort(String groupId, String portId); void deletePort(String groupId, String portId);

View File

@ -20,24 +20,19 @@ import java.util.Set;
import org.apache.nifi.controller.ProcessorNode; import org.apache.nifi.controller.ProcessorNode;
import org.apache.nifi.web.api.dto.ProcessorDTO; import org.apache.nifi.web.api.dto.ProcessorDTO;
/**
*
*/
public interface ProcessorDAO { public interface ProcessorDAO {
/** /**
* Determines if the specified processor is loaded. * @param groupId group id
* * @param id id
* @param groupId * @return Determines if the specified processor is loaded
* @param id
* @return
*/ */
boolean hasProcessor(String groupId, String id); boolean hasProcessor(String groupId, String id);
/** /**
* Creates a new Processor. * Creates a new Processor.
* *
* @param groupId * @param groupId group id
* @param processorDTO The processor DTO * @param processorDTO The processor DTO
* @return The new Processor * @return The new Processor
*/ */
@ -46,7 +41,7 @@ public interface ProcessorDAO {
/** /**
* Gets the Processor transfer object for the specified id. * Gets the Processor transfer object for the specified id.
* *
* @param groupId * @param groupId group id
* @param id Id of the processor to return * @param id Id of the processor to return
* @return The Processor * @return The Processor
*/ */
@ -55,7 +50,7 @@ public interface ProcessorDAO {
/** /**
* Gets all the Processor transfer objects for this controller. * Gets all the Processor transfer objects for this controller.
* *
* @param groupId * @param groupId group id
* @return List of all the Processors * @return List of all the Processors
*/ */
Set<ProcessorNode> getProcessors(String groupId); Set<ProcessorNode> getProcessors(String groupId);
@ -63,8 +58,8 @@ public interface ProcessorDAO {
/** /**
* Verifies the specified processor can be updated. * Verifies the specified processor can be updated.
* *
* @param groupId * @param groupId group id
* @param processorDTO * @param processorDTO processor
*/ */
void verifyUpdate(String groupId, ProcessorDTO processorDTO); void verifyUpdate(String groupId, ProcessorDTO processorDTO);
@ -72,24 +67,24 @@ public interface ProcessorDAO {
* Updates the configuration for the processor using the specified * Updates the configuration for the processor using the specified
* processorDTO. * processorDTO.
* *
* @param groupId * @param groupId group id
* @param processorDTO * @param processorDTO processor
* @return * @return updated processor
*/ */
ProcessorNode updateProcessor(String groupId, ProcessorDTO processorDTO); ProcessorNode updateProcessor(String groupId, ProcessorDTO processorDTO);
/** /**
* Verifies the specified processor can be removed. * Verifies the specified processor can be removed.
* *
* @param groupId * @param groupId group id
* @param processorId * @param processorId processor id
*/ */
void verifyDelete(String groupId, String processorId); void verifyDelete(String groupId, String processorId);
/** /**
* Deletes the specified processor. * Deletes the specified processor.
* *
* @param groupId * @param groupId group id
* @param processorId The processor id to delete * @param processorId The processor id to delete
*/ */
void deleteProcessor(String groupId, String processorId); void deleteProcessor(String groupId, String processorId);

View File

@ -22,24 +22,21 @@ import org.apache.nifi.remote.RemoteGroupPort;
import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO; import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO;
import org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO; import org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO;
/**
*
*/
public interface RemoteProcessGroupDAO { public interface RemoteProcessGroupDAO {
/** /**
* Determines if the specified remote process group exists. * Determines if the specified remote process group exists.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId * @param remoteProcessGroupId group id
* @return * @return true if the specified remote process group exists
*/ */
boolean hasRemoteProcessGroup(String groupId, String remoteProcessGroupId); boolean hasRemoteProcessGroup(String groupId, String remoteProcessGroupId);
/** /**
* Creates a remote process group reference. * Creates a remote process group reference.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroup The remote process group * @param remoteProcessGroup The remote process group
* @return The remote process group * @return The remote process group
*/ */
@ -48,7 +45,7 @@ public interface RemoteProcessGroupDAO {
/** /**
* Gets the specified remote process group. * Gets the specified remote process group.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId The remote process group id * @param remoteProcessGroupId The remote process group id
* @return The remote process group * @return The remote process group
*/ */
@ -57,7 +54,7 @@ public interface RemoteProcessGroupDAO {
/** /**
* Gets all of the remote process groups. * Gets all of the remote process groups.
* *
* @param groupId * @param groupId group id
* @return The remote process groups * @return The remote process groups
*/ */
Set<RemoteProcessGroup> getRemoteProcessGroups(String groupId); Set<RemoteProcessGroup> getRemoteProcessGroups(String groupId);
@ -65,33 +62,33 @@ public interface RemoteProcessGroupDAO {
/** /**
* Verifies the specified remote process group can be updated. * Verifies the specified remote process group can be updated.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroup * @param remoteProcessGroup group
*/ */
void verifyUpdate(String groupId, RemoteProcessGroupDTO remoteProcessGroup); void verifyUpdate(String groupId, RemoteProcessGroupDTO remoteProcessGroup);
/** /**
* Verifies the specified remote process group input port can be updated. * Verifies the specified remote process group input port can be updated.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId * @param remoteProcessGroupId process group id
* @param remoteProcessGroupPort * @param remoteProcessGroupPort port
*/ */
void verifyUpdateInputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort); void verifyUpdateInputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort);
/** /**
* Verifies the specified remote process group input port can be updated. * Verifies the specified remote process group input port can be updated.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId * @param remoteProcessGroupId group id
* @param remoteProcessGroupPort * @param remoteProcessGroupPort group port
*/ */
void verifyUpdateOutputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort); void verifyUpdateOutputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort);
/** /**
* Updates the specified remote process group. * Updates the specified remote process group.
* *
* @param groupId * @param groupId id
* @param remoteProcessGroup The remote process group * @param remoteProcessGroup The remote process group
* @return The remote process group * @return The remote process group
*/ */
@ -100,9 +97,9 @@ public interface RemoteProcessGroupDAO {
/** /**
* Updates the specified remote process group input port. * Updates the specified remote process group input port.
* *
* @param groupId * @param groupId id
* @param remoteProcessGroupId * @param remoteProcessGroupId id
* @param remoteProcessGroupPort * @param remoteProcessGroupPort port
* @return * @return
*/ */
RemoteGroupPort updateRemoteProcessGroupInputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort); RemoteGroupPort updateRemoteProcessGroupInputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort);
@ -110,9 +107,9 @@ public interface RemoteProcessGroupDAO {
/** /**
* Updates the specified remote process group output port. * Updates the specified remote process group output port.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId * @param remoteProcessGroupId group id
* @param remoteProcessGroupPort * @param remoteProcessGroupPort port
* @return * @return
*/ */
RemoteGroupPort updateRemoteProcessGroupOutputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort); RemoteGroupPort updateRemoteProcessGroupOutputPort(String groupId, String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPort);
@ -120,15 +117,15 @@ public interface RemoteProcessGroupDAO {
/** /**
* Verifies the specified remote process group can be removed. * Verifies the specified remote process group can be removed.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId * @param remoteProcessGroupId group id
*/ */
void verifyDelete(String groupId, String remoteProcessGroupId); void verifyDelete(String groupId, String remoteProcessGroupId);
/** /**
* Deletes the specified remote process group. * Deletes the specified remote process group.
* *
* @param groupId * @param groupId group id
* @param remoteProcessGroupId The remote process group id * @param remoteProcessGroupId The remote process group id
*/ */
void deleteRemoteProcessGroup(String groupId, String remoteProcessGroupId); void deleteRemoteProcessGroup(String groupId, String remoteProcessGroupId);

View File

@ -20,27 +20,24 @@ import org.apache.nifi.controller.Snippet;
import org.apache.nifi.web.api.dto.FlowSnippetDTO; import org.apache.nifi.web.api.dto.FlowSnippetDTO;
import org.apache.nifi.web.api.dto.SnippetDTO; import org.apache.nifi.web.api.dto.SnippetDTO;
/**
*
*/
public interface SnippetDAO { public interface SnippetDAO {
/** /**
* Copies the specified snippet and added the copy to the flow in the * Copies the specified snippet and added the copy to the flow in the
* specified group. * specified group.
* *
* @param groupId * @param groupId group id
* @param snippetId * @param snippetId snippet id
* @param originX * @param originX x
* @param originY * @param originY y
* @return * @return snippet
*/ */
FlowSnippetDTO copySnippet(String groupId, String snippetId, Double originX, Double originY); FlowSnippetDTO copySnippet(String groupId, String snippetId, Double originX, Double originY);
/** /**
* Creates a snippet. * Creates a snippet.
* *
* @param snippetDTO * @param snippetDTO snippet
* @return The snippet * @return The snippet
*/ */
Snippet createSnippet(SnippetDTO snippetDTO); Snippet createSnippet(SnippetDTO snippetDTO);
@ -48,8 +45,8 @@ public interface SnippetDAO {
/** /**
* Determines if the specified snippet exists. * Determines if the specified snippet exists.
* *
* @param snippetId * @param snippetId snippet id
* @return * @return true if the snippet exists
*/ */
boolean hasSnippet(String snippetId); boolean hasSnippet(String snippetId);
@ -64,14 +61,14 @@ public interface SnippetDAO {
/** /**
* Verifies the specified snippet can be updated. * Verifies the specified snippet can be updated.
* *
* @param snippetDTO * @param snippetDTO snippet
*/ */
void verifyUpdate(SnippetDTO snippetDTO); void verifyUpdate(SnippetDTO snippetDTO);
/** /**
* Updates the specified snippet. * Updates the specified snippet.
* *
* @param snippetDTO * @param snippetDTO snippet
* @return The snippet * @return The snippet
*/ */
Snippet updateSnippet(SnippetDTO snippetDTO); Snippet updateSnippet(SnippetDTO snippetDTO);
@ -79,7 +76,7 @@ public interface SnippetDAO {
/** /**
* Verifies the specified snippet can be removed. * Verifies the specified snippet can be removed.
* *
* @param snippetId * @param snippetId snippet id
*/ */
void verifyDelete(String snippetId); void verifyDelete(String snippetId);

View File

@ -174,7 +174,8 @@ public class StandardControllerServiceDAO extends ComponentDAO implements Contro
} }
/** /**
* Validates the specified configuration for the specified controller service. * Validates the specified configuration for the specified controller
* service.
* *
* @param controllerService * @param controllerService
* @param controllerServiceDTO * @param controllerServiceDTO

View File

@ -16,7 +16,6 @@
*/ */
package org.apache.nifi.web.dao.impl; package org.apache.nifi.web.dao.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;

View File

@ -20,7 +20,6 @@ import org.apache.nifi.cluster.manager.impl.WebClusterManager;
import org.apache.nifi.controller.FlowController; import org.apache.nifi.controller.FlowController;
import org.apache.nifi.controller.reporting.ReportingTaskProvider; import org.apache.nifi.controller.reporting.ReportingTaskProvider;
import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.web.dao.ControllerServiceDAO;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;

View File

@ -25,7 +25,6 @@ public enum Availability {
* Service or reporting task will run only on the NiFi Cluster Manager (NCM) * Service or reporting task will run only on the NiFi Cluster Manager (NCM)
*/ */
NCM, NCM,
/** /**
* Service or reporting task will run only on NiFi Nodes (or standalone * Service or reporting task will run only on NiFi Nodes (or standalone
* instance, if not clustered) * instance, if not clustered)

View File

@ -287,7 +287,6 @@ public final class SnippetUtils {
return false; return false;
} }
public FlowSnippetDTO copy(final FlowSnippetDTO snippetContents, final ProcessGroup group) { public FlowSnippetDTO copy(final FlowSnippetDTO snippetContents, final ProcessGroup group) {
final FlowSnippetDTO snippetCopy = copyContentsForGroup(snippetContents, group.getIdentifier(), null, null); final FlowSnippetDTO snippetCopy = copyContentsForGroup(snippetContents, group.getIdentifier(), null, null);
resolveNameConflicts(snippetCopy, group); resolveNameConflicts(snippetCopy, group);
@ -543,7 +542,6 @@ public final class SnippetUtils {
return snippetContentsCopy; return snippetContentsCopy;
} }
private void updateControllerServiceIdentifiers(final FlowSnippetDTO snippet, final Map<String, String> serviceIdMap) { private void updateControllerServiceIdentifiers(final FlowSnippetDTO snippet, final Map<String, String> serviceIdMap) {
final Set<ProcessorDTO> processors = snippet.getProcessors(); final Set<ProcessorDTO> processors = snippet.getProcessors();
if (processors != null) { if (processors != null) {
@ -579,7 +577,6 @@ public final class SnippetUtils {
} }
} }
/** /**
* Generates a new id for the current id that is specified. If no seed is * Generates a new id for the current id that is specified. If no seed is
* found, a new random id will be created. * found, a new random id will be created.

View File

@ -46,16 +46,9 @@ public class NiFiTestServer {
private static final Logger logger = LoggerFactory.getLogger(NiFiTestServer.class); private static final Logger logger = LoggerFactory.getLogger(NiFiTestServer.class);
private Server jetty; private Server jetty;
private NiFiProperties properties; private final NiFiProperties properties;
private WebAppContext webappContext; private WebAppContext webappContext;
/**
* Creates the NiFi test server.
*
* @param webappRoot
* @param contextPath
* @param props
*/
public NiFiTestServer(String webappRoot, String contextPath) { public NiFiTestServer(String webappRoot, String contextPath) {
// load the configuration // load the configuration
properties = NiFiProperties.getInstance(); properties = NiFiProperties.getInstance();
@ -64,13 +57,6 @@ public class NiFiTestServer {
createServer(); createServer();
} }
/**
* Creates the webapp context.
*
* @param webappRoot
* @param contextPath
* @return
*/
private WebAppContext createWebAppContext(String webappRoot, String contextPath) { private WebAppContext createWebAppContext(String webappRoot, String contextPath) {
webappContext = new WebAppContext(); webappContext = new WebAppContext();
webappContext.setContextPath(contextPath); webappContext.setContextPath(contextPath);
@ -80,12 +66,6 @@ public class NiFiTestServer {
return webappContext; return webappContext;
} }
/**
* Creates the server.
*
* @param webappContext
* @return
*/
private Server createServer() { private Server createServer() {
jetty = new Server(0); jetty = new Server(0);
@ -95,11 +75,6 @@ public class NiFiTestServer {
return jetty; return jetty;
} }
/**
* Creates the connector.
*
* @return
*/
private void createSecureConnector() { private void createSecureConnector() {
org.eclipse.jetty.util.ssl.SslContextFactory contextFactory = new org.eclipse.jetty.util.ssl.SslContextFactory(); org.eclipse.jetty.util.ssl.SslContextFactory contextFactory = new org.eclipse.jetty.util.ssl.SslContextFactory();
@ -155,11 +130,7 @@ public class NiFiTestServer {
jetty.addConnector(https); jetty.addConnector(https);
} }
/**
* Starts the server.
*
* @throws Exception
*/
public void startServer() throws Exception { public void startServer() throws Exception {
jetty.start(); jetty.start();
@ -167,9 +138,6 @@ public class NiFiTestServer {
webappContext.getServletContext().setAttribute("nifi-ui-extensions", new UiExtensionMapping(Collections.EMPTY_MAP)); webappContext.getServletContext().setAttribute("nifi-ui-extensions", new UiExtensionMapping(Collections.EMPTY_MAP));
} }
/**
* Loads the flow.
*/
public void loadFlow() throws Exception { public void loadFlow() throws Exception {
logger.info("Loading Flow..."); logger.info("Loading Flow...");
@ -180,20 +148,10 @@ public class NiFiTestServer {
logger.info("Flow loaded successfully."); logger.info("Flow loaded successfully.");
} }
/**
* Stops the server.
*
* @throws Exception
*/
public void shutdownServer() throws Exception { public void shutdownServer() throws Exception {
jetty.stop(); jetty.stop();
} }
/**
* Returns the port for the server.
*
* @return
*/
public int getPort() { public int getPort() {
if (!jetty.isStarted()) { if (!jetty.isStarted()) {
throw new IllegalStateException("Jetty server not started"); throw new IllegalStateException("Jetty server not started");
@ -201,20 +159,10 @@ public class NiFiTestServer {
return ((ServerConnector) jetty.getConnectors()[1]).getLocalPort(); return ((ServerConnector) jetty.getConnectors()[1]).getLocalPort();
} }
/**
* Returns the url for the server.
*
* @return
*/
public String getBaseUrl() { public String getBaseUrl() {
return "https://localhost:" + getPort(); return "https://localhost:" + getPort();
} }
/**
* Get a client for accessing the resources.
*
* @return
*/
public Client getClient() { public Client getClient() {
// create the client // create the client
return WebUtils.createClient(null, SslContextFactory.createSslContext(properties)); return WebUtils.createClient(null, SslContextFactory.createSslContext(properties));

View File

@ -259,9 +259,8 @@ public class ContentViewerController extends HttpServlet {
} }
/** /**
* Get the content request context based on the specified request. * @param request request
* @param request * @return Get the content request context based on the specified request
* @return
*/ */
private ContentRequestContext getContentRequest(final HttpServletRequest request) { private ContentRequestContext getContentRequest(final HttpServletRequest request) {
return new ContentRequestContext() { return new ContentRequestContext() {

View File

@ -23,18 +23,18 @@ import org.apache.nifi.distributed.cache.client.exception.DeserializationExcepti
/** /**
* Provides an interface for deserializing an array of bytes into an Object * Provides an interface for deserializing an array of bytes into an Object
* *
* @param <T> * @param <T> type
*/ */
public interface Deserializer<T> { public interface Deserializer<T> {
/** /**
* Deserializes the given byte array input an Object and returns that value. * Deserializes the given byte array input an Object and returns that value.
* *
* @param input * @param input input
* @return * @return returns deserialized value
* @throws DeserializationException if a valid object cannot be deserialized * @throws DeserializationException if a valid object cannot be deserialized
* from the given byte array * from the given byte array
* @throws java.io.IOException * @throws java.io.IOException ex
*/ */
T deserialize(byte[] input) throws DeserializationException, IOException; T deserialize(byte[] input) throws DeserializationException, IOException;

View File

@ -37,12 +37,12 @@ public interface DistributedMapCacheClient extends ControllerService {
* present, serializing the key and value with the given * present, serializing the key and value with the given
* {@link Serializer}s. * {@link Serializer}s.
* *
* @param <K> * @param <K> type of key
* @param <V> * @param <V> type of value
* @param key the key for into the map * @param key the key for into the map
* @param value the value to add to the map if and only if the key is absent * @param value the value to add to the map if and only if the key is absent
* @param keySerializer * @param keySerializer key serializer
* @param valueSerializer * @param valueSerializer value serializer
* @return true if the value was added to the cache, false if the value * @return true if the value was added to the cache, false if the value
* already existed in the cache * already existed in the cache
* *
@ -57,15 +57,17 @@ public interface DistributedMapCacheClient extends ControllerService {
* key, the value associated with the key is returned, after being * key, the value associated with the key is returned, after being
* deserialized with the given valueDeserializer. * deserialized with the given valueDeserializer.
* *
* @param <K> * @param <K> type of key
* @param <V> * @param <V> type of value
* @param key * @param key key
* @param value * @param value value
* @param keySerializer * @param keySerializer key serializer
* @param valueSerializer * @param valueSerializer key serializer
* @param valueDeserializer * @param valueDeserializer value deserializer
* @return * @return If a value already exists in the cache for the given
* @throws IOException * key, the value associated with the key is returned, after being
* deserialized with the given valueDeserializer
* @throws IOException ex
*/ */
<K, V> V getAndPutIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> valueDeserializer) throws IOException; <K, V> V getAndPutIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> valueDeserializer) throws IOException;
@ -73,46 +75,46 @@ public interface DistributedMapCacheClient extends ControllerService {
* Determines if the given value is present in the cache and if so returns * Determines if the given value is present in the cache and if so returns
* <code>true</code>, else returns <code>false</code> * <code>true</code>, else returns <code>false</code>
* *
* @param <K> * @param <K> type of key
* @param key * @param key key
* @param keySerializer * @param keySerializer key serializer
* @return * @return Determines if the given value is present in the cache and if so returns
* <code>true</code>, else returns <code>false</code>
* *
* @throws IOException if unable to communicate with the remote instance * @throws IOException if unable to communicate with the remote instance
*/ */
<K> boolean containsKey(K key, Serializer<K> keySerializer) throws IOException; <K> boolean containsKey(K key, Serializer<K> keySerializer) throws IOException;
/** /**
* Returns the value in the cache for the given key, if one exists; * @param <K> type of key
* otherwise returns <code>null</code> * @param <V> type of value
*
* @param <K>
* @param <V>
* @param key the key to lookup in the map * @param key the key to lookup in the map
* @param keySerializer * @param keySerializer key serializer
* @param valueDeserializer * @param valueDeserializer value serializer
* *
* @return * @return the value in the cache for the given key, if one exists;
* @throws IOException * otherwise returns <code>null</code>
* @throws IOException ex
*/ */
<K, V> V get(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException; <K, V> V get(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException;
/** /**
* Attempts to notify the server that we are finished communicating with it * Attempts to notify the server that we are finished communicating with it
* and cleans up resources * and cleans up resources
* @throws java.io.IOException *
* @throws java.io.IOException ex
*/ */
void close() throws IOException; void close() throws IOException;
/** /**
* Removes the entry with the given key from the cache, if it is present. * Removes the entry with the given key from the cache, if it is present.
* *
* @param <K> * @param <K> type of key
* @param key * @param key key
* @param serializer * @param serializer serializer
* @return <code>true</code> if the entry is removed, <code>false</code> if * @return <code>true</code> if the entry is removed, <code>false</code> if
* the key did not exist in the cache * the key did not exist in the cache
* @throws IOException * @throws IOException ex
*/ */
<K> boolean remove(K key, Serializer<K> serializer) throws IOException; <K> boolean remove(K key, Serializer<K> serializer) throws IOException;

View File

@ -35,9 +35,9 @@ public interface DistributedSetCacheClient extends ControllerService {
* Adds the specified value to the cache, serializing the value with the * Adds the specified value to the cache, serializing the value with the
* given {@link Serializer}. * given {@link Serializer}.
* *
* @param <T> * @param <T> type
* @param value * @param value value
* @param serializer * @param serializer serializer
* @return true if the value was added to the cache, false if the value * @return true if the value was added to the cache, false if the value
* already existed in the cache * already existed in the cache
* *
@ -46,14 +46,12 @@ public interface DistributedSetCacheClient extends ControllerService {
<T> boolean addIfAbsent(T value, Serializer<T> serializer) throws IOException; <T> boolean addIfAbsent(T value, Serializer<T> serializer) throws IOException;
/** /**
* Returns if the given value is present in the cache and if so returns * @param <T> type
* @param value value
* @param serializer serializer
* @return if the given value is present in the cache and if so returns
* <code>true</code>, else returns <code>false</code> * <code>true</code>, else returns <code>false</code>
* *
* @param <T>
* @param value
* @param serializer
* @return
*
* @throws IOException if unable to communicate with the remote instance * @throws IOException if unable to communicate with the remote instance
*/ */
<T> boolean contains(T value, Serializer<T> serializer) throws IOException; <T> boolean contains(T value, Serializer<T> serializer) throws IOException;
@ -61,19 +59,20 @@ public interface DistributedSetCacheClient extends ControllerService {
/** /**
* Removes the given value from the cache, if it is present. * Removes the given value from the cache, if it is present.
* *
* @param <T> * @param <T> type
* @param value * @param value value
* @param serializer * @param serializer serializer
* @return <code>true</code> if the value is removed, <code>false</code> if * @return <code>true</code> if the value is removed, <code>false</code> if
* the value did not exist in the cache * the value did not exist in the cache
* @throws IOException * @throws IOException ex
*/ */
<T> boolean remove(T value, Serializer<T> serializer) throws IOException; <T> boolean remove(T value, Serializer<T> serializer) throws IOException;
/** /**
* Attempts to notify the server that we are finished communicating with it * Attempts to notify the server that we are finished communicating with it
* and cleans up resources * and cleans up resources
* @throws java.io.IOException *
* @throws java.io.IOException ex
*/ */
void close() throws IOException; void close() throws IOException;
} }

View File

@ -23,17 +23,18 @@ import org.apache.nifi.distributed.cache.client.exception.SerializationException
/** /**
* Provides a mechanism by which a value can be serialized to a stream of bytes * Provides a mechanism by which a value can be serialized to a stream of bytes
* @param <T> *
* @param <T> type to serialize
*/ */
public interface Serializer<T> { public interface Serializer<T> {
/** /**
* Serializes the given value to the {@link OutputStream} * Serializes the given value to the {@link OutputStream}
* *
* @param value * @param value value
* @param output * @param output stream
* @throws SerializationException If unable to serialize the given value * @throws SerializationException If unable to serialize the given value
* @throws java.io.IOException * @throws java.io.IOException ex
*/ */
void serialize(T value, OutputStream output) throws SerializationException, IOException; void serialize(T value, OutputStream output) throws SerializationException, IOException;