@Test public void testRequestChain() { final String proxyIdentity2 = "proxy-2"; final String proxyIdentity1 = "proxy-1"; final String userIdentity = "user"; withReplicator(replicator -> { final Set<NodeIdentifier> nodeIds = new HashSet<>(); nodeIds.add(new NodeIdentifier("1", "localhost", 8000, "localhost", 8001, "localhost", 8002, 8003, false)); final URI uri = new URI("http: final Entity entity = new ProcessorEntity(); final NiFiUser proxy2 = new Builder().identity(proxyIdentity2).build(); final NiFiUser proxy1 = new Builder().identity(proxyIdentity1).chain(proxy2).build(); final NiFiUser user = new Builder().identity(userIdentity).chain(proxy1).build(); final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(user)); SecurityContextHolder.getContext().setAuthentication(authentication); replicator.replicate(nodeIds, HttpMethod.GET, uri, entity, new HashMap<>(), true, true); }, Response.Status.OK, 0L, null, "<" + userIdentity + "><" + proxyIdentity1 + "><" + proxyIdentity2 +">"); }
@Override public AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers) { return replicate(NiFiUserUtils.getNiFiUser(), method, uri, entity, headers); }
ThreadPoolRequestReplicator implements RequestReplicator { @Override public AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers) { return replicate(NiFiUserUtils.getNiFiUser(), method, uri, entity, headers); } }
ThreadPoolRequestReplicator implements RequestReplicator { @Override public AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers) { return replicate(NiFiUserUtils.getNiFiUser(), method, uri, entity, headers); } ThreadPoolRequestReplicator(final int corePoolSize, final int maxPoolSize, final int maxConcurrentRequests, final HttpReplicationClient client,
        final ClusterCoordinator clusterCoordinator, final RequestCompletionCallback callback, final EventReporter eventReporter, final NiFiProperties nifiProperties); }
ThreadPoolRequestReplicator implements RequestReplicator { @Override public AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers) { return replicate(NiFiUserUtils.getNiFiUser(), method, uri, entity, headers); } ThreadPoolRequestReplicator(final int corePoolSize, final int maxPoolSize, final int maxConcurrentRequests, final HttpReplicationClient client,
        final ClusterCoordinator clusterCoordinator, final RequestCompletionCallback callback, final EventReporter eventReporter, final NiFiProperties nifiProperties); @Override void shutdown(); @Override AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers); @Override AsyncClusterResponse replicate(NiFiUser user, String method, URI uri, Object entity, Map<String, String> headers); @Override AsyncClusterResponse replicate(Set<NodeIdentifier> nodeIds, String method, URI uri, Object entity, Map<String, String> headers,
                final boolean indicateReplicated, final boolean performVerification); @Override AsyncClusterResponse replicate(Set<NodeIdentifier> nodeIds, final NiFiUser user, String method, URI uri, Object entity, Map<String, String> headers,
                                          final boolean indicateReplicated, final boolean performVerification); @Override AsyncClusterResponse forwardToCoordinator(final NodeIdentifier coordinatorNodeId, final String method, final URI uri, final Object entity, final Map<String, String> headers); @Override AsyncClusterResponse forwardToCoordinator(final NodeIdentifier coordinatorNodeId, final NiFiUser user, final String method,
                final URI uri, final Object entity, final Map<String, String> headers); @Override AsyncClusterResponse getClusterResponse(final String identifier); }
ThreadPoolRequestReplicator implements RequestReplicator { @Override public AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers) { return replicate(NiFiUserUtils.getNiFiUser(), method, uri, entity, headers); } ThreadPoolRequestReplicator(final int corePoolSize, final int maxPoolSize, final int maxConcurrentRequests, final HttpReplicationClient client,
        final ClusterCoordinator clusterCoordinator, final RequestCompletionCallback callback, final EventReporter eventReporter, final NiFiProperties nifiProperties); @Override void shutdown(); @Override AsyncClusterResponse replicate(String method, URI uri, Object entity, Map<String, String> headers); @Override AsyncClusterResponse replicate(NiFiUser user, String method, URI uri, Object entity, Map<String, String> headers); @Override AsyncClusterResponse replicate(Set<NodeIdentifier> nodeIds, String method, URI uri, Object entity, Map<String, String> headers,
                final boolean indicateReplicated, final boolean performVerification); @Override AsyncClusterResponse replicate(Set<NodeIdentifier> nodeIds, final NiFiUser user, String method, URI uri, Object entity, Map<String, String> headers,
                                          final boolean indicateReplicated, final boolean performVerification); @Override AsyncClusterResponse forwardToCoordinator(final NodeIdentifier coordinatorNodeId, final String method, final URI uri, final Object entity, final Map<String, String> headers); @Override AsyncClusterResponse forwardToCoordinator(final NodeIdentifier coordinatorNodeId, final NiFiUser user, final String method,
                final URI uri, final Object entity, final Map<String, String> headers); @Override AsyncClusterResponse getClusterResponse(final String identifier);  }