You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2015/04/22 23:12:55 UTC
[05/49] incubator-nifi git commit: NIFI-271 checkpoint push because
there are so many changes. Long way to go but got through dto library
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/test/java/org/apache/nifi/remote/io/socket/ssl/TestSSLSocketChannel.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/test/java/org/apache/nifi/remote/io/socket/ssl/TestSSLSocketChannel.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/test/java/org/apache/nifi/remote/io/socket/ssl/TestSSLSocketChannel.java
index 4c91f75..8fe7149 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/test/java/org/apache/nifi/remote/io/socket/ssl/TestSSLSocketChannel.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/test/java/org/apache/nifi/remote/io/socket/ssl/TestSSLSocketChannel.java
@@ -61,19 +61,19 @@ package org.apache.nifi.remote.io.socket.ssl;
////@Ignore("For local testing only")
//public class TestSSLSocketChannel {
// public static final int DATA_SIZE = 4096;
-//
+//
// @Test
// @Ignore
// public void testSendingToLocalInstance() throws IOException, InterruptedException, HandshakeException, UnknownPortException, PortNotRunningException, URISyntaxException {
// System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-//
+//
// final NiFiProperties properties = NiFiProperties.getInstance();
// final SSLContext sslContext = SslContextFactory.createSslContext(properties);
-//
+//
// final SSLSocketChannel channel = new SSLSocketChannel(sslContext, "localhost", 5000, true);
// channel.setTimeout(2000000);
// channel.connect();
-//
+//
// final CommunicationsSession commsSession;
// commsSession = new SSLSocketChannelCommunicationsSession(channel, "", null);
// commsSession.setUri("nifi://localhost:5000");
@@ -82,7 +82,7 @@ package org.apache.nifi.remote.io.socket.ssl;
//
// dos.write(CommunicationsProtocol.MAGIC_BYTES);
// dos.flush();
-//
+//
// final EventReporter eventReporter = Mockito.mock(EventReporter.class);
// final StandardSiteToSiteProtocol proposedProtocol = new StandardSiteToSiteProtocol(commsSession, eventReporter, NiFiProperties.getInstance());
// final StandardSiteToSiteProtocol negotiatedProtocol = (StandardSiteToSiteProtocol) RemoteResourceFactory.initiateResourceNegotiation(proposedProtocol, dis, dos);
@@ -91,25 +91,25 @@ package org.apache.nifi.remote.io.socket.ssl;
// final RemoteProcessGroup rpg = Mockito.mock(RemoteProcessGroup.class);
// Mockito.when(rpg.getCommunicationsTimeout(Mockito.any(TimeUnit.class))).thenReturn(2000);
// Mockito.when(rpg.getTargetUri()).thenReturn( new URI("https://localhost:5050/") );
-//
+//
// final RemoteGroupPort port = Mockito.mock(RemoteGroupPort.class);
// Mockito.when(port.getIdentifier()).thenReturn("90880680-d6da-40be-b2cc-a15423de2e1a");
// Mockito.when(port.getName()).thenReturn("Data In");
// Mockito.when(port.getRemoteProcessGroup()).thenReturn(rpg);
-//
+//
// negotiatedProtocol.initiateHandshake(port, TransferDirection.SEND);
// }
-//
+//
// @Test
// public void testWithSimpleSSLSocket() throws IOException, InterruptedException {
// System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-//
+//
// final NiFiProperties properties = NiFiProperties.getInstance();
// final SSLContext sslContext = SslContextFactory.createSslContext(properties);
-//
+//
// final ServerThread server = new ServerThread(sslContext);
// server.start();
-//
+//
// int port = server.getPort();
// while ( port <= 0 ) {
// Thread.sleep(10L);
@@ -118,7 +118,7 @@ package org.apache.nifi.remote.io.socket.ssl;
//
// final Socket socket = sslContext.getSocketFactory().createSocket("localhost", port);
// final OutputStream out = socket.getOutputStream();
-//
+//
// final byte[] sent = new byte[DATA_SIZE];
// for (int i=0; i < sent.length; i++) {
// sent[i] = (byte) (i % 255);
@@ -133,17 +133,17 @@ package org.apache.nifi.remote.io.socket.ssl;
// final float MBperS = megabytes / seconds;
// System.out.println("Millis: " + millis + "; MB/s: " + MBperS);
// }
-//
+//
// @Test
// public void testDirectChannelComms() throws IOException, InterruptedException {
// System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-//
+//
// final NiFiProperties properties = NiFiProperties.getInstance();
// final SSLContext sslContext = SslContextFactory.createSslContext(properties);
-//
+//
// final ServerThread server = new ServerThread(sslContext);
// server.start();
-//
+//
// int port = server.getPort();
// while ( port <= 0 ) {
// Thread.sleep(10L);
@@ -161,12 +161,12 @@ package org.apache.nifi.remote.io.socket.ssl;
//
// for (int itr=0; itr < 2; itr++) {
// channel.write(sent);
-//
+//
// Thread.sleep(250L);
// final byte[] received = server.getReceivedData();
// server.clearReceivedData();
// assertTrue(Arrays.equals(sent, received));
-//
+//
// int len;
// final byte[] buffer = new byte[4096];
// final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -183,23 +183,23 @@ package org.apache.nifi.remote.io.socket.ssl;
// }
// }
// }
-//
+//
// channel.close();
// server.shutdown();
// }
//
-//
+//
// @Test
// public void testWriteTimesOut() throws IOException, InterruptedException {
// System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-//
+//
// final NiFiProperties properties = NiFiProperties.getInstance();
// final SSLContext sslContext = SslContextFactory.createSslContext(properties);
-//
+//
// final ServerThread server = new ServerThread(sslContext);
// server.delayReading(2000);
// server.start();
-//
+//
// int port = server.getPort();
// while ( port <= 0 ) {
// Thread.sleep(10L);
@@ -209,9 +209,9 @@ package org.apache.nifi.remote.io.socket.ssl;
// final SSLSocketChannel channel = new SSLSocketChannel(sslContext, "localhost", port, true);
// channel.setTimeout(1000);
// channel.connect();
-//
+//
// final OutputStream out = new SSLSocketChannelOutputStream(channel);
-//
+//
// final byte[] sent = new byte[1024 * 1024];
// for (int i=0; i < sent.length; i++) {
// sent[i] = (byte) (i % 255);
@@ -225,25 +225,25 @@ package org.apache.nifi.remote.io.socket.ssl;
// }
//
// server.delayReading(0);
-//
+//
// try {
// channel.close();
// } catch (final Exception e) {}
-//
+//
// server.shutdown();
// }
-//
-//
+//
+//
// @Test
// public void testInputOutputStreams() throws IOException, InterruptedException {
// System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-//
+//
// final NiFiProperties properties = NiFiProperties.getInstance();
// final SSLContext sslContext = SslContextFactory.createSslContext(properties);
-//
+//
// final ServerThread server = new ServerThread(sslContext);
// server.start();
-//
+//
// int port = server.getPort();
// while ( port <= 0 ) {
// Thread.sleep(10L);
@@ -253,11 +253,11 @@ package org.apache.nifi.remote.io.socket.ssl;
// final SSLSocketChannel channel = new SSLSocketChannel(sslContext, "localhost", port, true);
// channel.setTimeout(2000);
// channel.connect();
-//
+//
// final OutputStream out = new SSLSocketChannelOutputStream(channel);
// final InputStream in = new SSLSocketChannelInputStream(channel);
// final DataInputStream dataIn = new DataInputStream(in);
-//
+//
// final byte[] sent = new byte[DATA_SIZE];
// for (int i=0; i < sent.length; i++) {
// sent[i] = (byte) (i % 255);
@@ -272,22 +272,22 @@ package org.apache.nifi.remote.io.socket.ssl;
// final float megabytes = (float) DATA_SIZE / (1024F * 1024F);
// final float MBperS = megabytes / seconds;
// System.out.println("Millis: " + millis + "; MB/s: " + MBperS);
-//
+//
// Thread.sleep(500L);
// final byte[] received = server.getReceivedData();
// System.out.println("Server received " + received.length + " bytes");
// server.clearReceivedData();
// assertTrue(Arrays.equals(sent, received));
-//
+//
// final long val = dataIn.readLong();
// assertEquals(DATA_SIZE, val);
// System.out.println(val);
// }
-//
+//
// channel.close();
// server.shutdown();
// }
-//
+//
// public final long toLong(final byte[] buffer) throws IOException {
// return (((long)buffer[0] << 56) +
// ((long)(buffer[1] & 255) << 48) +
@@ -298,82 +298,82 @@ package org.apache.nifi.remote.io.socket.ssl;
// ((buffer[6] & 255) << 8) +
// ((buffer[7] & 255) << 0));
// }
-//
+//
// private static class ServerThread extends Thread {
// private final SSLContext sslContext;
// private int listeningPort;
// private final ByteArrayOutputStream received = new ByteArrayOutputStream();
-//
+//
// private volatile int readingDelay = 0;
// private volatile boolean shutdown = false;
-//
+//
// public ServerThread(final SSLContext sslContext) {
// this.sslContext = sslContext;
// }
-//
+//
// public int getPort() {
// return listeningPort;
// }
-//
+//
// public byte[] getReceivedData() {
// return received.toByteArray();
// }
-//
+//
// @Override
// public void run() {
// try {
// final SSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();
// final SSLServerSocket serverSocket = (SSLServerSocket) sslServerSocketFactory.createServerSocket(0);
// serverSocket.setNeedClientAuth(true);
-//
+//
// this.listeningPort = serverSocket.getLocalPort();
-//
+//
// final Socket socket = serverSocket.accept();
-//// socket.setSoTimeout(250);
+// socket.setSoTimeout(250);
// final InputStream stream = socket.getInputStream();
// final DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
-//
+//
// final byte[] buffer = new byte[1024];
// int len;
-//
+//
// while (!shutdown) {
// try {
// len = stream.read(buffer);
-//
+//
// if ( readingDelay > 0 ) {
// try { Thread.sleep(readingDelay); } catch (final InterruptedException e) {}
// }
// } catch (final SocketTimeoutException e) {
// continue;
// }
-//
+//
// if ( len < 0 ) {
// return;
// }
-//
+//
// received.write(buffer, 0, len);
-//
+//
// final long length = received.size();
// if ( length % (DATA_SIZE) == 0 ) {
// dos.writeLong(length);
// dos.flush();
// }
// }
-//
+//
// System.out.println("Server successfully shutdown");
// } catch (final Exception e) {
// e.printStackTrace();
// }
// }
-//
+//
// public void clearReceivedData() {
// this.received.reset();
// }
-//
+//
// public void shutdown() {
// this.shutdown = true;
// }
-//
+//
// public void delayReading(final int millis) {
// this.readingDelay = millis;
// }
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentAccess.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentAccess.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentAccess.java
index a093c59..f28617a 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentAccess.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentAccess.java
@@ -18,7 +18,7 @@ package org.apache.nifi.web;
/**
* Provides access to content within NiFi.
- *
+ *
* @author unattributed
*/
public interface ContentAccess {
@@ -26,8 +26,8 @@ public interface ContentAccess {
/**
* Gets the content for the specified claim.
*
- * @param request
- * @return
+ * @param request the context of the request
+ * @return the downloadable content
*/
DownloadableContent getContent(ContentRequestContext request);
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentRequestContext.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentRequestContext.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentRequestContext.java
index f5744ee..6154576 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentRequestContext.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/ContentRequestContext.java
@@ -20,32 +20,32 @@ package org.apache.nifi.web;
* A request for content.
*/
public interface ContentRequestContext {
-
+
/**
* The URI to the data.
- *
- * @return
+ *
+ * @return the uri of the data
*/
String getDataUri();
-
+
/**
* If clustered, this is the id of the node the data resides on.
- *
- * @return
+ *
+ * @return the the cluster node identifier
*/
String getClusterNodeId();
-
+
/**
* The client id for the user making the request.
- *
- * @return
+ *
+ * @return the client identifier
*/
String getClientId();
-
+
/**
* The proxy chain for the current request, if applicable.
- *
- * @return
+ *
+ * @return the proxied entities chain
*/
String getProxiedEntitiesChain();
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/DownloadableContent.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/DownloadableContent.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/DownloadableContent.java
index a23673f..5a34cbc 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/DownloadableContent.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/src/main/java/org/apache/nifi/web/DownloadableContent.java
@@ -35,8 +35,8 @@ public final class DownloadableContent {
/**
* The filename of the content.
- *
- * @return
+ *
+ * @return the filename
*/
public String getFilename() {
return filename;
@@ -44,8 +44,8 @@ public final class DownloadableContent {
/**
* The content type of the content.
- *
- * @return
+ *
+ * @return the content type
*/
public String getType() {
return type;
@@ -53,8 +53,8 @@ public final class DownloadableContent {
/**
* The content stream.
- *
- * @return
+ *
+ * @return the intput stream of the content
*/
public InputStream getContent() {
return content;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/ProtocolHandshake.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/ProtocolHandshake.java b/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/ProtocolHandshake.java
index 55cf51f..f36ac15 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/ProtocolHandshake.java
+++ b/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/ProtocolHandshake.java
@@ -27,47 +27,44 @@ import org.apache.nifi.remote.VersionNegotiator;
public class ProtocolHandshake {
- public static final byte[] MAGIC_HEADER = new byte[] { 'N', 'i', 'F', 'i' };
-
+ public static final byte[] MAGIC_HEADER = new byte[]{'N', 'i', 'F', 'i'};
+
public static final int RESOURCE_OK = 20;
public static final int DIFFERENT_RESOURCE_VERSION = 21;
public static final int ABORT = 255;
-
public static void initiateHandshake(final InputStream in, final OutputStream out, final VersionNegotiator versionNegotiator) throws IOException, HandshakeException {
final DataInputStream dis = new DataInputStream(in);
final DataOutputStream dos = new DataOutputStream(out);
-
+
try {
dos.write(MAGIC_HEADER);
-
+
initiateVersionNegotiation(versionNegotiator, dis, dos);
} finally {
dos.flush();
}
}
-
public static void receiveHandshake(final InputStream in, final OutputStream out, final VersionNegotiator versionNegotiator) throws IOException, HandshakeException {
final DataInputStream dis = new DataInputStream(in);
final DataOutputStream dos = new DataOutputStream(out);
-
+
try {
final byte[] magicHeaderBuffer = new byte[MAGIC_HEADER.length];
dis.readFully(magicHeaderBuffer);
-
+
receiveVersionNegotiation(versionNegotiator, dis, dos);
} finally {
dos.flush();
}
}
-
-
+
private static void initiateVersionNegotiation(final VersionNegotiator negotiator, final DataInputStream dis, final DataOutputStream dos) throws IOException, HandshakeException {
// Write the classname of the RemoteStreamCodec, followed by its version
dos.writeInt(negotiator.getVersion());
dos.flush();
-
+
// wait for response from server.
final int statusCode = dis.read();
switch (statusCode) {
@@ -76,16 +73,16 @@ public class ProtocolHandshake {
case DIFFERENT_RESOURCE_VERSION: // server accepted our proposal of codec name but not the version
// Get server's preferred version
final int newVersion = dis.readInt();
-
+
// Determine our new preferred version that is no greater than the server's preferred version.
final Integer newPreference = negotiator.getPreferredVersion(newVersion);
// If we could not agree with server on a version, fail now.
- if ( newPreference == null ) {
+ if (newPreference == null) {
throw new HandshakeException("Could not agree on protocol version");
}
-
+
negotiator.setVersion(newPreference);
-
+
// Attempt negotiation of resource based on our new preferred version.
initiateVersionNegotiation(negotiator, dis, dos);
case ABORT:
@@ -94,17 +91,17 @@ public class ProtocolHandshake {
throw new HandshakeException("Received unexpected response code " + statusCode + " when negotiating version with remote server");
}
}
-
+
private static void receiveVersionNegotiation(final VersionNegotiator negotiator, final DataInputStream dis, final DataOutputStream dos) throws IOException, HandshakeException {
final int version = dis.readInt();
- if ( negotiator.isVersionSupported(version) ) {
+ if (negotiator.isVersionSupported(version)) {
dos.write(RESOURCE_OK);
dos.flush();
-
+
negotiator.setVersion(version);
} else {
final Integer preferred = negotiator.getPreferredVersion(version);
- if ( preferred == null ) {
+ if (preferred == null) {
dos.write(ABORT);
dos.flush();
throw new HandshakeException("Unable to negotiate an acceptable version of the Distributed Cache Protocol");
@@ -112,7 +109,7 @@ public class ProtocolHandshake {
dos.write(DIFFERENT_RESOURCE_VERSION);
dos.writeInt(preferred);
dos.flush();
-
+
receiveVersionNegotiation(negotiator, dis, dos);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/exception/HandshakeException.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/exception/HandshakeException.java b/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/exception/HandshakeException.java
index 8049d42..9746da5 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/exception/HandshakeException.java
+++ b/nifi/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/src/main/java/org/apache/nifi/distributed/cache/protocol/exception/HandshakeException.java
@@ -17,10 +17,11 @@
package org.apache.nifi.distributed.cache.protocol.exception;
public class HandshakeException extends Exception {
+
public HandshakeException(final String message) {
super(message);
}
-
+
public HandshakeException(final Throwable cause) {
super(cause);
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/Criteria.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/Criteria.java b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/Criteria.java
index 471e30b..345a923 100644
--- a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/Criteria.java
+++ b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/Criteria.java
@@ -27,13 +27,13 @@ import java.util.Map;
*/
public class Criteria {
- // note: this class does not need to be synchronized/locked due to
+ // note: this class does not need to be synchronized/locked due to
// its usage. a new instance is used for getting or updating the
// rule criteria due to the nature of how annotation data is set.
// this will be a new instance for each request and the setting of
// annotation data is protected by a rest api wide write-lock.
- // likewise, the processor uses this class as a simple look up. if
- // this ever changed (not likely) then we would have to introduce
+ // likewise, the processor uses this class as a simple look up. if
+ // this ever changed (not likely) then we would have to introduce
// some thread safety here.
private Map<String, Rule> rules;
private FlowFilePolicy flowFilePolicy;
@@ -56,7 +56,7 @@ public class Criteria {
/**
* Adds the specified rule to the end of the rule collection.
*
- * @param rule
+ * @param rule the rule to add
*/
public void addRule(final Rule rule) {
rules.put(rule.getId(), rule);
@@ -65,8 +65,8 @@ public class Criteria {
/**
* Gets the specified rule from the rule collection.
*
- * @param ruleId
- * @return
+ * @param ruleId the identifier of the rule to get
+ * @return the identified rule
*/
public Rule getRule(final String ruleId) {
return rules.get(ruleId);
@@ -75,7 +75,7 @@ public class Criteria {
/**
* Deletes the specified rule from the rule collection.
*
- * @param rule
+ * @param rule the rule to delete
*/
public void deleteRule(final Rule rule) {
rules.remove(rule.getId());
@@ -84,7 +84,7 @@ public class Criteria {
/**
* Returns the rule ordering.
*
- * @return
+ * @return the rule keys in rule order
*/
public List<String> getRuleOrder() {
return Collections.unmodifiableList(new ArrayList<>(rules.keySet()));
@@ -94,7 +94,7 @@ public class Criteria {
* Reorders the rule collection. The specified new rule order must contain
* the rule id for each rule in the collection.
*
- * @param newRuleOrder
+ * @param newRuleOrder the new rule order to use by key
*/
public void reorder(final List<String> newRuleOrder) {
// ensure all known rules are accounted for
@@ -115,7 +115,7 @@ public class Criteria {
/**
* Returns a listing of all Rules.
*
- * @return
+ * @return all rules
*/
public List<Rule> getRules() {
return Collections.unmodifiableList(new ArrayList<>(rules.values()));
@@ -124,7 +124,7 @@ public class Criteria {
/**
* Sets the flow file policy.
*
- * @param flowFilePolicy
+ * @param flowFilePolicy the new policy
*/
public void setFlowFilePolicy(FlowFilePolicy flowFilePolicy) {
this.flowFilePolicy = flowFilePolicy;
@@ -133,7 +133,7 @@ public class Criteria {
/**
* Gets the flow file policy.
*
- * @return
+ * @return the current policy
*/
public FlowFilePolicy getFlowFilePolicy() {
return flowFilePolicy;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/9faaef8c/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/serde/CriteriaSerDe.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/serde/CriteriaSerDe.java b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/serde/CriteriaSerDe.java
index 4940d28..f1cd126 100644
--- a/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/serde/CriteriaSerDe.java
+++ b/nifi/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/src/main/java/org/apache/nifi/update/attributes/serde/CriteriaSerDe.java
@@ -73,8 +73,8 @@ public class CriteriaSerDe {
/**
* Serializes the specified criteria.
*
- * @param criteria
- * @return
+ * @param criteria to serialize
+ * @return the string representation of the given criteria
*/
public static String serialize(final Criteria criteria) {
final StringWriter writer = new StringWriter();
@@ -101,8 +101,8 @@ public class CriteriaSerDe {
/**
* Deserializes the specified criteria.
*
- * @param string
- * @return
+ * @param string the string representation of the criteria
+ * @return the criteria object
*/
public static Criteria deserialize(final String string) {
Criteria criteria = null;