NIFI-4019:

- Adding support for X-Forwarded-* headers.
- Unrelated code clean up.
- Addressing additional proxying issues.
- Addressing mistyped landing page.
- Handled trailing slashes in proxy headers for context path
This commit is contained in:
Matt Gilman 2017-06-08 09:38:07 -04:00 committed by Jeff Storck
parent c0ad5bcc7b
commit 490e1da5db
81 changed files with 278 additions and 228 deletions

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>AmbariReportingTask</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeAMQP</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PublishAMQP</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>CompareFuzzyHash</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css"
<link rel="stylesheet" href="../../../../../css/component-usage.css"
type="text/css" />
</head>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>DataDogReportingTask</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeIMAP</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css"
<link rel="stylesheet" href="../../../../../css/component-usage.css"
type="text/css" />
</head>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumePOP3</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css"
<link rel="stylesheet" href="../../../../../css/component-usage.css"
type="text/css" />
</head>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>ParseEvtx</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ExecuteFlumeSink</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ExecuteFlumeSource</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -100,7 +100,7 @@ public class HtmlDocumentationWriter implements DocumentationWriter {
xmlStreamWriter.writeStartElement("link");
xmlStreamWriter.writeAttribute("rel", "stylesheet");
xmlStreamWriter.writeAttribute("href", "/nifi-docs/css/component-usage.css");
xmlStreamWriter.writeAttribute("href", "../../../../../css/component-usage.css");
xmlStreamWriter.writeAttribute("type", "text/css");
xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEndElement();
@ -438,7 +438,7 @@ public class HtmlDocumentationWriter implements DocumentationWriter {
xmlStreamWriter.writeCharacters(", ");
}
xmlStreamWriter.writeCharacters("whether a property supports the ");
writeLink(xmlStreamWriter, "NiFi Expression Language", "/nifi-docs/html/expression-language-guide.html");
writeLink(xmlStreamWriter, "NiFi Expression Language", "../../../../../html/expression-language-guide.html");
}
if (containsSensitiveProperties) {
xmlStreamWriter.writeCharacters(", and whether a property is considered " + "\"sensitive\", meaning that its value will be encrypted. Before entering a "
@ -596,7 +596,7 @@ public class HtmlDocumentationWriter implements DocumentationWriter {
throws XMLStreamException {
xmlStreamWriter.writeCharacters(" ");
xmlStreamWriter.writeStartElement("img");
xmlStreamWriter.writeAttribute("src", "/nifi-docs/html/images/iconInfo.png");
xmlStreamWriter.writeAttribute("src", "../../../../../html/images/iconInfo.png");
xmlStreamWriter.writeAttribute("alt", description);
xmlStreamWriter.writeAttribute("title", description);
xmlStreamWriter.writeEndElement();
@ -799,7 +799,7 @@ public class HtmlDocumentationWriter implements DocumentationWriter {
xmlStreamWriter.writeCharacters(separator);
}
}
writeLink(xmlStreamWriter, linkedComponent.getSimpleName(), "/nifi-docs/components/" + group + "/" + id + "/" + version + "/" + linkedComponent.getCanonicalName() + "/index.html");
writeLink(xmlStreamWriter, linkedComponent.getSimpleName(), "../../../../../components/" + group + "/" + id + "/" + version + "/" + linkedComponent.getCanonicalName() + "/index.html");
++index;
} else {
@ -827,7 +827,7 @@ public class HtmlDocumentationWriter implements DocumentationWriter {
final String id = firstCoordinate.getId();
final String version = firstCoordinate.getVersion();
final String link = "/nifi-docs/components/" + group + "/" + id + "/" + version + "/" + className + "/index.html";
final String link = "../../../../../components/" + group + "/" + id + "/" + version + "/" + className + "/index.html";
final int indexOfLastPeriod = className.lastIndexOf(".") + 1;

View File

@ -162,7 +162,7 @@ public class AccessPolicyResource extends ApplicationResource {
final AccessPolicyEntity entity = serviceFacade.getAccessPolicy(requestAction, resource);
populateRemainingAccessPolicyEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -----------------------
@ -255,7 +255,7 @@ public class AccessPolicyResource extends ApplicationResource {
populateRemainingAccessPolicyEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -312,7 +312,7 @@ public class AccessPolicyResource extends ApplicationResource {
final AccessPolicyEntity entity = serviceFacade.getAccessPolicy(id);
populateRemainingAccessPolicyEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -397,7 +397,7 @@ public class AccessPolicyResource extends ApplicationResource {
final AccessPolicyEntity entity = serviceFacade.updateAccessPolicy(revision, accessPolicyDTO);
populateRemainingAccessPolicyEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -484,7 +484,7 @@ public class AccessPolicyResource extends ApplicationResource {
(revision, accessPolicyEntity) -> {
// delete the specified access policy
final AccessPolicyEntity entity = serviceFacade.deleteAccessPolicy(revision, accessPolicyEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -122,7 +122,7 @@ public class AccessResource extends ApplicationResource {
entity.setConfig(accessConfiguration);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**

View File

@ -100,11 +100,17 @@ public abstract class ApplicationResource {
public static final String VERSION = "version";
public static final String CLIENT_ID = "clientId";
public static final String PROXY_SCHEME_HTTP_HEADER = "X-ProxyScheme";
public static final String PROXY_HOST_HTTP_HEADER = "X-ProxyHost";
public static final String PROXY_PORT_HTTP_HEADER = "X-ProxyPort";
public static final String PROXY_CONTEXT_PATH_HTTP_HEADER = "X-ProxyContextPath";
public static final String FORWARDED_PROTO_HTTP_HEADER = "X-Forwarded-Proto";
public static final String FORWARDED_HOST_HTTP_HEADER = "X-Forwarded-Server";
public static final String FORWARDED_PORT_HTTP_HEADER = "X-Forwarded-Port";
public static final String FORWARDED_CONTEXT_HTTP_HEADER = "X-Forwarded-Context";
protected static final String NON_GUARANTEED_ENDPOINT = "Note: This endpoint is subject to change as NiFi and it's REST API evolve.";
private static final Logger logger = LoggerFactory.getLogger(ApplicationResource.class);
@ -141,10 +147,10 @@ public abstract class ApplicationResource {
try {
// check for proxy settings
final String scheme = httpServletRequest.getHeader(PROXY_SCHEME_HTTP_HEADER);
final String host = httpServletRequest.getHeader(PROXY_HOST_HTTP_HEADER);
final String port = httpServletRequest.getHeader(PROXY_PORT_HTTP_HEADER);
String baseContextPath = httpServletRequest.getHeader(PROXY_CONTEXT_PATH_HTTP_HEADER);
final String scheme = getFirstHeaderValue(PROXY_SCHEME_HTTP_HEADER, FORWARDED_PROTO_HTTP_HEADER);
final String host = getFirstHeaderValue(PROXY_HOST_HTTP_HEADER, FORWARDED_HOST_HTTP_HEADER);
final String port = getFirstHeaderValue(PROXY_PORT_HTTP_HEADER, FORWARDED_PORT_HTTP_HEADER);
String baseContextPath = getFirstHeaderValue(PROXY_CONTEXT_PATH_HTTP_HEADER, FORWARDED_CONTEXT_HTTP_HEADER);
// if necessary, prepend the context path
String resourcePath = uri.getPath();
@ -154,6 +160,10 @@ public abstract class ApplicationResource {
baseContextPath = "/" + baseContextPath;
}
if (baseContextPath.endsWith("/")) {
baseContextPath = StringUtils.substringBeforeLast(baseContextPath, "/");
}
// determine the complete resource path
resourcePath = baseContextPath + resourcePath;
}
@ -202,18 +212,6 @@ public abstract class ApplicationResource {
return response.cacheControl(cacheControl);
}
/**
* If the application is operating as a node, then this method adds the cluster context information to the response using the response header 'X-CLUSTER_CONTEXT'.
*
* @param response response
* @return builder
*/
protected ResponseBuilder clusterContext(final ResponseBuilder response) {
// TODO: Remove this method. Since ClusterContext was removed, it is no longer needed. However,
// it is called by practically every endpoint so for now it is just being stubbed out.
return response;
}
protected String generateUuid() {
final Optional<String> seed = getIdGenerationSeed();
UUID uuid;
@ -345,16 +343,20 @@ public abstract class ApplicationResource {
}
}
// set the proxy details to request details if not already set client
final String proxyScheme = httpServletRequest.getHeader(PROXY_SCHEME_HTTP_HEADER);
// if the scheme is not set by the client, include the details from this request but don't override
final String proxyScheme = getFirstHeaderValue(PROXY_SCHEME_HTTP_HEADER, FORWARDED_PROTO_HTTP_HEADER);
if (proxyScheme == null) {
result.put(PROXY_SCHEME_HTTP_HEADER, httpServletRequest.getScheme());
}
final String proxyHost = httpServletRequest.getHeader(PROXY_HOST_HTTP_HEADER);
// if the host is not set by the client, include the details from this request but don't override
final String proxyHost = getFirstHeaderValue(PROXY_HOST_HTTP_HEADER, FORWARDED_HOST_HTTP_HEADER);
if (proxyHost == null) {
result.put(PROXY_HOST_HTTP_HEADER, httpServletRequest.getServerName());
}
final String proxyPort = httpServletRequest.getHeader(PROXY_PORT_HTTP_HEADER);
// if the port is not set by the client, include the details from this request but don't override
final String proxyPort = getFirstHeaderValue(PROXY_PORT_HTTP_HEADER, FORWARDED_PORT_HTTP_HEADER);
if (proxyPort == null) {
result.put(PROXY_PORT_HTTP_HEADER, String.valueOf(httpServletRequest.getServerPort()));
}
@ -362,6 +364,31 @@ public abstract class ApplicationResource {
return result;
}
/**
* Returns the value for the first key discovered when inspecting the current request. Will
* return null if there are no keys specified or if none of the specified keys are found.
*
* @param keys http header keys
* @return the value for the first key found
*/
private String getFirstHeaderValue(final String... keys) {
if (keys == null) {
return null;
}
for (final String key : keys) {
final String value = httpServletRequest.getHeader(key);
// if we found an entry for this key, return the value
if (value != null) {
return value;
}
}
// unable to find any matching keys
return null;
}
/**
* Checks whether the request is part of a two-phase commit style request (either phase 1 or phase 2)
*

View File

@ -143,7 +143,7 @@ public class ConnectionResource extends ApplicationResource {
populateRemainingConnectionEntityContent(entity);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -272,7 +272,7 @@ public class ConnectionResource extends ApplicationResource {
populateRemainingConnectionEntityContent(entity);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
});
}
@ -358,7 +358,7 @@ public class ConnectionResource extends ApplicationResource {
final ConnectionEntity entity = serviceFacade.deleteConnection(revision, connectionEntity.getId());
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -168,7 +168,7 @@ public class ControllerResource extends ApplicationResource {
}
final ControllerConfigurationEntity entity = serviceFacade.getControllerConfiguration();
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -227,7 +227,7 @@ public class ControllerResource extends ApplicationResource {
null,
(revision, configEntity) -> {
final ControllerConfigurationEntity entity = serviceFacade.updateControllerConfiguration(revision, configEntity.getComponent());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -329,7 +329,7 @@ public class ControllerResource extends ApplicationResource {
reportingTaskResource.populateRemainingReportingTaskEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -500,7 +500,7 @@ public class ControllerResource extends ApplicationResource {
controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}

View File

@ -188,7 +188,7 @@ public class ControllerServiceResource extends ApplicationResource {
final ControllerServiceEntity entity = serviceFacade.getControllerService(id);
populateRemainingControllerServiceEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -253,7 +253,7 @@ public class ControllerServiceResource extends ApplicationResource {
entity.setPropertyDescriptor(descriptor);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -307,7 +307,7 @@ public class ControllerServiceResource extends ApplicationResource {
entity.setComponentState(state);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -368,7 +368,7 @@ public class ControllerServiceResource extends ApplicationResource {
final ComponentStateEntity entity = new ComponentStateEntity();
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -419,7 +419,7 @@ public class ControllerServiceResource extends ApplicationResource {
// get the controller service
final ControllerServiceReferencingComponentsEntity entity = serviceFacade.getControllerServiceReferencingComponents(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -551,7 +551,7 @@ public class ControllerServiceResource extends ApplicationResource {
final ControllerServiceReferencingComponentsEntity entity = serviceFacade.updateControllerServiceReferencingComponents(
referencingRevisions, updateReferenceRequest.getId(), scheduledState, controllerServiceState);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -638,7 +638,7 @@ public class ControllerServiceResource extends ApplicationResource {
final ControllerServiceEntity entity = serviceFacade.updateControllerService(revision, controllerService);
populateRemainingControllerServiceEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -725,7 +725,7 @@ public class ControllerServiceResource extends ApplicationResource {
(revision, controllerServiceEntity) -> {
// delete the specified controller service
final ControllerServiceEntity entity = serviceFacade.deleteControllerService(revision, controllerServiceEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -205,7 +205,7 @@ public class CountersResource extends ApplicationResource {
entity.setCounters(countersReport);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -266,7 +266,7 @@ public class CountersResource extends ApplicationResource {
entity.setCounter(counter);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -473,13 +473,13 @@ public class DataTransferResource extends ApplicationResource {
entity.setMessage(e.getMessage());
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST).entity(entity);
return clusterContext(noCache(builder)).build();
return noCache(builder).build();
}
return responseCreator.unexpectedErrorResponse(portId, transactionId, e);
}
return clusterContext(noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager))).build();
return noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager)).build();
}
@ -579,7 +579,7 @@ public class DataTransferResource extends ApplicationResource {
// it's not clear if there is an issue at server side, or cancel operation has been accomplished.
// Above conditions can guarantee this is the latter case, we return 200 OK here.
entity.setResponseCode(ResponseCode.CANCEL_TRANSACTION.getCode());
return clusterContext(noCache(Response.ok(entity))).build();
return noCache(Response.ok(entity)).build();
} else {
return responseCreator.unexpectedErrorResponse(portId, transactionId, e);
}
@ -592,7 +592,7 @@ public class DataTransferResource extends ApplicationResource {
return responseCreator.unexpectedErrorResponse(portId, transactionId, e);
}
return clusterContext(noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager))).build();
return noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager)).build();
}
private Response cancelTransaction(String transactionId, TransactionResultEntity entity) {
@ -798,7 +798,7 @@ public class DataTransferResource extends ApplicationResource {
final TransactionResultEntity entity = new TransactionResultEntity();
entity.setResponseCode(ResponseCode.CONTINUE_TRANSACTION.getCode());
entity.setMessage("Extended TTL.");
return clusterContext(noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager))).build();
return noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager)).build();
} catch (HandshakeException e) {
return responseCreator.handshakeExceptionResponse(e);

View File

@ -256,7 +256,7 @@ public class FlowResource extends ApplicationResource {
)
public Response generateClientId() {
authorizeFlow();
return clusterContext(generateOkResponse(generateUuid())).build();
return generateOkResponse(generateUuid()).build();
}
/**
@ -292,7 +292,7 @@ public class FlowResource extends ApplicationResource {
}
final FlowConfigurationEntity entity = serviceFacade.getFlowConfiguration();
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -329,7 +329,7 @@ public class FlowResource extends ApplicationResource {
final CurrentUserEntity entity = serviceFacade.getCurrentUser();
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -375,7 +375,7 @@ public class FlowResource extends ApplicationResource {
// get this process group flow
final ProcessGroupFlowEntity entity = serviceFacade.getProcessGroupFlow(groupId);
populateRemainingFlowContent(entity.getProcessGroupFlow());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -------------------
@ -424,7 +424,7 @@ public class FlowResource extends ApplicationResource {
entity.setControllerServices(controllerServices);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -475,7 +475,7 @@ public class FlowResource extends ApplicationResource {
entity.setControllerServices(controllerServices);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ---------------
@ -523,7 +523,7 @@ public class FlowResource extends ApplicationResource {
entity.setReportingTasks(reportingTasks);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -669,7 +669,7 @@ public class FlowResource extends ApplicationResource {
// update the process group
final ScheduleComponentsEntity entity = serviceFacade.scheduleComponents(id, scheduledState, componentRevisions);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -716,7 +716,7 @@ public class FlowResource extends ApplicationResource {
entity.setSearchResultsDTO(results);
// generate the response
return clusterContext(noCache(Response.ok(entity))).build();
return noCache(Response.ok(entity)).build();
}
/**
@ -759,7 +759,7 @@ public class FlowResource extends ApplicationResource {
entity.setControllerStatus(controllerStatus);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -816,7 +816,7 @@ public class FlowResource extends ApplicationResource {
entity.setClusterSummary(clusterConfiguration);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -856,7 +856,7 @@ public class FlowResource extends ApplicationResource {
}
final ControllerBulletinsEntity entity = serviceFacade.getControllerBulletins();
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -900,7 +900,7 @@ public class FlowResource extends ApplicationResource {
entity.setBanners(bannerDTO);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -957,7 +957,7 @@ public class FlowResource extends ApplicationResource {
entity.setProcessorTypes(serviceFacade.getProcessorTypes(bundleGroupFilter, bundleArtifactFilter, typeFilter));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1042,7 +1042,7 @@ public class FlowResource extends ApplicationResource {
bundleGroupFilter, bundleArtifactFilter, typeFilter));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1099,7 +1099,7 @@ public class FlowResource extends ApplicationResource {
entity.setReportingTaskTypes(serviceFacade.getReportingTaskTypes(bundleGroupFilter, bundleArtifactFilter, typeFilter));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1140,7 +1140,7 @@ public class FlowResource extends ApplicationResource {
entity.setPrioritizerTypes(serviceFacade.getWorkQueuePrioritizerTypes());
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1199,7 +1199,7 @@ public class FlowResource extends ApplicationResource {
entity.setAbout(aboutDTO);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// --------------
@ -1308,7 +1308,7 @@ public class FlowResource extends ApplicationResource {
entity.setBulletinBoard(bulletinBoard);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ------
@ -1385,7 +1385,7 @@ public class FlowResource extends ApplicationResource {
// get the specified processor status
final ProcessorStatusEntity entity = serviceFacade.getProcessorStatus(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1458,7 +1458,7 @@ public class FlowResource extends ApplicationResource {
// get the specified input port status
final PortStatusEntity entity = serviceFacade.getInputPortStatus(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1531,7 +1531,7 @@ public class FlowResource extends ApplicationResource {
// get the specified output port status
final PortStatusEntity entity = serviceFacade.getOutputPortStatus(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1604,7 +1604,7 @@ public class FlowResource extends ApplicationResource {
// get the specified remote process group status
final RemoteProcessGroupStatusEntity entity = serviceFacade.getRemoteProcessGroupStatus(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1685,7 +1685,7 @@ public class FlowResource extends ApplicationResource {
// get the status
final ProcessGroupStatusEntity entity = serviceFacade.getProcessGroupStatus(groupId, recursive);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1758,7 +1758,7 @@ public class FlowResource extends ApplicationResource {
// get the specified connection status
final ConnectionStatusEntity entity = serviceFacade.getConnectionStatus(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// --------------
@ -1808,7 +1808,7 @@ public class FlowResource extends ApplicationResource {
// get the specified processor status history
final StatusHistoryEntity entity = serviceFacade.getProcessorStatusHistory(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1854,7 +1854,7 @@ public class FlowResource extends ApplicationResource {
// get the specified processor status history
final StatusHistoryEntity entity = serviceFacade.getProcessGroupStatusHistory(groupId);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1900,7 +1900,7 @@ public class FlowResource extends ApplicationResource {
// get the specified processor status history
final StatusHistoryEntity entity = serviceFacade.getRemoteProcessGroupStatusHistory(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -1946,7 +1946,7 @@ public class FlowResource extends ApplicationResource {
// get the specified processor status history
final StatusHistoryEntity entity = serviceFacade.getConnectionStatusHistory(id);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -------
@ -2308,7 +2308,7 @@ public class FlowResource extends ApplicationResource {
entity.setGenerated(new Date());
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// --------------------

View File

@ -135,7 +135,7 @@ public class FunnelResource extends ApplicationResource {
final FunnelEntity entity = serviceFacade.getFunnel(id);
populateRemainingFunnelEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -220,7 +220,7 @@ public class FunnelResource extends ApplicationResource {
final FunnelEntity entity = serviceFacade.updateFunnel(revision, funnelEntity.getComponent());
populateRemainingFunnelEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -302,7 +302,7 @@ public class FunnelResource extends ApplicationResource {
(revision, funnelEntity) -> {
// delete the specified funnel
final FunnelEntity entity = serviceFacade.deleteFunnel(revision, funnelEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -135,7 +135,7 @@ public class InputPortResource extends ApplicationResource {
final PortEntity entity = serviceFacade.getInputPort(id);
populateRemainingInputPortEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -222,7 +222,7 @@ public class InputPortResource extends ApplicationResource {
final PortEntity entity = serviceFacade.updateInputPort(revision, portDTO);
populateRemainingInputPortEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -301,7 +301,7 @@ public class InputPortResource extends ApplicationResource {
(revision, portEntity) -> {
// delete the specified input port
final PortEntity entity = serviceFacade.deleteInputPort(revision, portEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -135,7 +135,7 @@ public class LabelResource extends ApplicationResource {
final LabelEntity entity = serviceFacade.getLabel(id);
populateRemainingLabelEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -222,7 +222,7 @@ public class LabelResource extends ApplicationResource {
final LabelEntity entity = serviceFacade.updateLabel(revision, labelDTO);
populateRemainingLabelEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -301,7 +301,7 @@ public class LabelResource extends ApplicationResource {
(revision, labelEntity) -> {
// delete the specified label
final LabelEntity entity = serviceFacade.deleteLabel(revision, labelEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -135,7 +135,7 @@ public class OutputPortResource extends ApplicationResource {
final PortEntity entity = serviceFacade.getOutputPort(id);
populateRemainingOutputPortEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -222,7 +222,7 @@ public class OutputPortResource extends ApplicationResource {
final PortEntity entity = serviceFacade.updateOutputPort(revision, portDTO);
populateRemainingOutputPortEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -301,7 +301,7 @@ public class OutputPortResource extends ApplicationResource {
(revision, portEntity) -> {
// delete the specified output port
final PortEntity entity = serviceFacade.deleteOutputPort(revision, portEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -236,7 +236,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.getComponent().setContents(null);
}
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -321,7 +321,7 @@ public class ProcessGroupResource extends ApplicationResource {
final ProcessGroupEntity entity = serviceFacade.updateProcessGroup(revision, processGroupEntity.getComponent());
populateRemainingProcessGroupEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -410,7 +410,7 @@ public class ProcessGroupResource extends ApplicationResource {
final ProcessGroupEntity entity = serviceFacade.deleteProcessGroup(revision, processGroupEntity.getId());
// create the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -503,7 +503,7 @@ public class ProcessGroupResource extends ApplicationResource {
// generate a 201 created response
String uri = entity.getUri();
return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build();
return generateCreatedResponse(URI.create(uri), entity).build();
}
);
}
@ -565,7 +565,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setProcessGroups(populateRemainingProcessGroupEntitiesContent(entities));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ----------
@ -689,7 +689,7 @@ public class ProcessGroupResource extends ApplicationResource {
// generate a 201 created response
String uri = entity.getUri();
return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build();
return generateCreatedResponse(URI.create(uri), entity).build();
}
);
}
@ -745,7 +745,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setProcessors(processorResource.populateRemainingProcessorEntitiesContent(processors));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -----------
@ -839,7 +839,7 @@ public class ProcessGroupResource extends ApplicationResource {
inputPortResource.populateRemainingInputPortEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -893,7 +893,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setInputPorts(inputPortResource.populateRemainingInputPortEntitiesContent(inputPorts));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ------------
@ -987,7 +987,7 @@ public class ProcessGroupResource extends ApplicationResource {
outputPortResource.populateRemainingOutputPortEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -1042,7 +1042,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setOutputPorts(outputPortResource.populateRemainingOutputPortEntitiesContent(outputPorts));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -------
@ -1136,7 +1136,7 @@ public class ProcessGroupResource extends ApplicationResource {
funnelResource.populateRemainingFunnelEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -1191,7 +1191,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setFunnels(funnelResource.populateRemainingFunnelEntitiesContent(funnels));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ------
@ -1285,7 +1285,7 @@ public class ProcessGroupResource extends ApplicationResource {
labelResource.populateRemainingLabelEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -1340,7 +1340,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setLabels(labelResource.populateRemainingLabelEntitiesContent(labels));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ---------------------
@ -1449,7 +1449,7 @@ public class ProcessGroupResource extends ApplicationResource {
final RemoteProcessGroupEntity entity = serviceFacade.createRemoteProcessGroup(revision, groupId, remoteProcessGroupDTO);
remoteProcessGroupResource.populateRemainingRemoteProcessGroupEntityContent(entity);
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -1511,7 +1511,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setRemoteProcessGroups(remoteProcessGroupResource.populateRemainingRemoteProcessGroupEntitiesContent(remoteProcessGroups));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// -----------
@ -1677,7 +1677,7 @@ public class ProcessGroupResource extends ApplicationResource {
// extract the href and build the response
String uri = entity.getUri();
return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build();
return generateCreatedResponse(URI.create(uri), entity).build();
}
);
}
@ -1732,7 +1732,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setConnections(connectionResource.populateRemainingConnectionEntitiesContent(connections));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// ----------------
@ -1838,7 +1838,7 @@ public class ProcessGroupResource extends ApplicationResource {
populateRemainingSnippetContent(flow);
// generate the response
return clusterContext(generateCreatedResponse(getAbsolutePath(), flowEntity)).build();
return generateCreatedResponse(getAbsolutePath(), flowEntity).build();
}
);
}
@ -2009,7 +2009,7 @@ public class ProcessGroupResource extends ApplicationResource {
populateRemainingSnippetContent(flowSnippet);
// generate the response
return clusterContext(generateCreatedResponse(getAbsolutePath(), entity)).build();
return generateCreatedResponse(getAbsolutePath(), entity).build();
}
);
}
@ -2096,7 +2096,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setTemplate(template);
// build the response
return clusterContext(generateCreatedResponse(URI.create(template.getUri()), entity)).build();
return generateCreatedResponse(URI.create(template.getUri()), entity).build();
}
);
}
@ -2251,7 +2251,7 @@ public class ProcessGroupResource extends ApplicationResource {
entity.setTemplate(template);
// build the response
return clusterContext(generateCreatedResponse(URI.create(template.getUri()), entity)).build();
return generateCreatedResponse(URI.create(template.getUri()), entity).build();
} catch (IllegalArgumentException | IllegalStateException e) {
logger.info("Unable to import template: " + e);
String responseXml = String.format("<errorResponse status=\"%s\" statusText=\"%s\"/>", Response.Status.BAD_REQUEST.getStatusCode(), e.getMessage());
@ -2377,7 +2377,7 @@ public class ProcessGroupResource extends ApplicationResource {
controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}

View File

@ -189,7 +189,7 @@ public class ProcessorResource extends ApplicationResource {
populateRemainingProcessorEntityContent(entity);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -260,7 +260,7 @@ public class ProcessorResource extends ApplicationResource {
entity.setPropertyDescriptor(descriptor);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -315,7 +315,7 @@ public class ProcessorResource extends ApplicationResource {
entity.setComponentState(state);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -377,7 +377,7 @@ public class ProcessorResource extends ApplicationResource {
final ComponentStateEntity entity = new ComponentStateEntity();
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -475,7 +475,7 @@ public class ProcessorResource extends ApplicationResource {
final ProcessorEntity entity = serviceFacade.updateProcessor(revision, processorDTO);
populateRemainingProcessorEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -560,7 +560,7 @@ public class ProcessorResource extends ApplicationResource {
final ProcessorEntity entity = serviceFacade.deleteProcessor(revision, processorEntity.getId());
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -300,7 +300,7 @@ public class ProvenanceEventResource extends ApplicationResource {
entity.setProvenanceEvent(event);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -376,7 +376,7 @@ public class ProvenanceEventResource extends ApplicationResource {
// generate the response
URI uri = URI.create(generateResourceUri("provenance-events", event.getId()));
return clusterContext(generateCreatedResponse(uri, entity)).build();
return generateCreatedResponse(uri, entity).build();
}
// setters

View File

@ -168,7 +168,7 @@ public class ProvenanceResource extends ApplicationResource {
entity.setProvenanceOptions(searchOptions);
// generate the response
return clusterContext(noCache(Response.ok(entity))).build();
return noCache(Response.ok(entity)).build();
}
/**
@ -266,7 +266,7 @@ public class ProvenanceResource extends ApplicationResource {
entity.setProvenance(dto);
// generate the response
return clusterContext(generateCreatedResponse(URI.create(dto.getUri()), entity)).build();
return generateCreatedResponse(URI.create(dto.getUri()), entity).build();
}
);
}
@ -345,7 +345,7 @@ public class ProvenanceResource extends ApplicationResource {
entity.setProvenance(dto);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -413,7 +413,7 @@ public class ProvenanceResource extends ApplicationResource {
serviceFacade.deleteProvenance(entity.getId());
// generate the response
return clusterContext(generateOkResponse(new ProvenanceEntity())).build();
return generateOkResponse(new ProvenanceEntity()).build();
}
);
}
@ -521,7 +521,7 @@ public class ProvenanceResource extends ApplicationResource {
entity.setLineage(dto);
// generate the response
return clusterContext(generateCreatedResponse(URI.create(dto.getUri()), entity)).build();
return generateCreatedResponse(URI.create(dto.getUri()), entity).build();
}
);
}
@ -582,7 +582,7 @@ public class ProvenanceResource extends ApplicationResource {
entity.setLineage(dto);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -644,7 +644,7 @@ public class ProvenanceResource extends ApplicationResource {
serviceFacade.deleteLineage(entity.getId());
// generate the response
return clusterContext(generateOkResponse(new LineageEntity())).build();
return generateOkResponse(new LineageEntity()).build();
}
);
}

View File

@ -139,7 +139,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
final RemoteProcessGroupEntity entity = serviceFacade.getRemoteProcessGroup(id);
populateRemainingRemoteProcessGroupEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -215,7 +215,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
() -> serviceFacade.verifyDeleteRemoteProcessGroup(id),
(revision, remoteProcessGroupEntity) -> {
final RemoteProcessGroupEntity entity = serviceFacade.deleteRemoteProcessGroup(revision, remoteProcessGroupEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -316,7 +316,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
entity.setRevision(updatedRevision);
entity.setRemoteProcessGroupPort(controllerResponse.getRemoteProcessGroupPort());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -418,7 +418,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
entity.setRevision(updatedRevision);
entity.setRemoteProcessGroupPort(controllerResponse.getRemoteProcessGroupPort());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -539,7 +539,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
final RemoteProcessGroupEntity entity = serviceFacade.updateRemoteProcessGroup(revision, remoteProcessGroup);
populateRemainingRemoteProcessGroupEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -175,7 +175,7 @@ public class ReportingTaskResource extends ApplicationResource {
final ReportingTaskEntity reportingTask = serviceFacade.getReportingTask(id);
populateRemainingReportingTaskEntityContent(reportingTask);
return clusterContext(generateOkResponse(reportingTask)).build();
return generateOkResponse(reportingTask).build();
}
/**
@ -240,7 +240,7 @@ public class ReportingTaskResource extends ApplicationResource {
entity.setPropertyDescriptor(descriptor);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -294,7 +294,7 @@ public class ReportingTaskResource extends ApplicationResource {
entity.setComponentState(state);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -355,7 +355,7 @@ public class ReportingTaskResource extends ApplicationResource {
final ComponentStateEntity entity = new ComponentStateEntity();
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -442,7 +442,7 @@ public class ReportingTaskResource extends ApplicationResource {
final ReportingTaskEntity entity = serviceFacade.updateReportingTask(revision, reportingTaskDTO);
populateRemainingReportingTaskEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -528,7 +528,7 @@ public class ReportingTaskResource extends ApplicationResource {
(revision, reportingTaskEntity) -> {
// delete the specified reporting task
final ReportingTaskEntity entity = serviceFacade.deleteReportingTask(revision, reportingTaskEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -123,7 +123,7 @@ public class ResourceResource extends ApplicationResource {
entity.setResources(resources);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// setters

View File

@ -173,7 +173,7 @@ public class SiteToSiteResource extends ApplicationResource {
}
// generate the response
return clusterContext(noCache(Response.ok(entity))).build();
return noCache(Response.ok(entity)).build();
}
/**
@ -263,7 +263,7 @@ public class SiteToSiteResource extends ApplicationResource {
final PeersEntity entity = new PeersEntity();
entity.setPeers(peers);
return clusterContext(noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager))).build();
return noCache(setCommonHeaders(Response.ok(entity), transportProtocolVersion, transactionManager)).build();
}
// setters

View File

@ -199,7 +199,7 @@ public class SnippetResource extends ApplicationResource {
populateRemainingSnippetEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getSnippet().getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getSnippet().getUri()), entity).build();
}
);
}
@ -281,7 +281,7 @@ public class SnippetResource extends ApplicationResource {
// update the snippet
final SnippetEntity entity = serviceFacade.updateSnippet(revisions, snippetEntity.getSnippet());
populateRemainingSnippetEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -347,7 +347,7 @@ public class SnippetResource extends ApplicationResource {
(revisions, entity) -> {
// delete the specified snippet
final SnippetEntity snippetEntity = serviceFacade.deleteSnippet(revisions, entity.getId());
return clusterContext(generateOkResponse(snippetEntity)).build();
return generateOkResponse(snippetEntity).build();
}
);
}

View File

@ -165,7 +165,7 @@ public class SystemDiagnosticsResource extends ApplicationResource {
entity.setSystemDiagnostics(systemDiagnosticsDto);
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
// setters

View File

@ -213,7 +213,7 @@ public class TemplateResource extends ApplicationResource {
// build the response entity
final TemplateEntity entity = new TemplateEntity();
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -194,7 +194,7 @@ public class TenantsResource extends ApplicationResource {
populateRemainingUserEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -252,7 +252,7 @@ public class TenantsResource extends ApplicationResource {
final UserEntity entity = serviceFacade.getUser(id);
populateRemainingUserEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -307,7 +307,7 @@ public class TenantsResource extends ApplicationResource {
entity.setUsers(populateRemainingUserEntitiesContent(users));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -391,7 +391,7 @@ public class TenantsResource extends ApplicationResource {
final UserEntity entity = serviceFacade.updateUser(revision, userEntity.getComponent());
populateRemainingUserEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -473,7 +473,7 @@ public class TenantsResource extends ApplicationResource {
(revision, userEntity) -> {
// delete the specified user
final UserEntity entity = serviceFacade.deleteUser(revision, userEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -583,7 +583,7 @@ public class TenantsResource extends ApplicationResource {
populateRemainingUserGroupEntityContent(entity);
// build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
return generateCreatedResponse(URI.create(entity.getUri()), entity).build();
}
);
}
@ -641,7 +641,7 @@ public class TenantsResource extends ApplicationResource {
final UserGroupEntity entity = serviceFacade.getUserGroup(id);
populateRemainingUserGroupEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -695,7 +695,7 @@ public class TenantsResource extends ApplicationResource {
entity.setUserGroups(populateRemainingUserGroupEntitiesContent(users));
// generate the response
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
/**
@ -779,7 +779,7 @@ public class TenantsResource extends ApplicationResource {
final UserGroupEntity entity = serviceFacade.updateUserGroup(revision, userGroupEntity.getComponent());
populateRemainingUserGroupEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}
@ -861,7 +861,7 @@ public class TenantsResource extends ApplicationResource {
(revision, userGroupEntity) -> {
// delete the specified user group
final UserGroupEntity entity = serviceFacade.deleteUserGroup(revision, userGroupEntity.getId());
return clusterContext(generateOkResponse(entity)).build();
return generateOkResponse(entity).build();
}
);
}

View File

@ -17,7 +17,18 @@
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html>
<html>
<% String contextPath = "/".equals(request.getContextPath()) ? "" : request.getContextPath(); %>
<%
String contextPath = request.getHeader("X-ProxyContextPath");
if (contextPath == null) {
contextPath = request.getHeader("X-Forwarded-Context");
}
if (contextPath == null) {
contextPath = "";
}
if (contextPath.endsWith("/")) {
contextPath = contextPath.substring(0, contextPath.length() - 1);
}
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<%= contextPath %>/nifi/images/nifi16.ico"/>

View File

@ -17,16 +17,28 @@
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<%
String contextPath = request.getHeader("X-ProxyContextPath");
if (contextPath == null) {
contextPath = request.getHeader("X-Forwarded-Context");
}
if (contextPath == null) {
contextPath = "";
}
if (contextPath.endsWith("/")) {
contextPath = contextPath.substring(0, contextPath.length() - 1);
}
%>
<head>
<title><%= request.getAttribute("title") == null ? "" : org.apache.nifi.util.EscapeUtils.escapeHtml(request.getAttribute("title").toString()) %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="images/nifi16.ico"/>
<link rel="stylesheet" href="/nifi/assets/reset.css/reset.css" type="text/css" />
<link rel="stylesheet" href="/nifi/css/common-ui.css" type="text/css" />
<link rel="stylesheet" href="/nifi/fonts/flowfont/flowfont.css" type="text/css" />
<link rel="stylesheet" href="/nifi/assets/font-awesome/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="/nifi/css/message-pane.css" type="text/css" />
<link rel="stylesheet" href="/nifi/css/message-page.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/assets/reset.css/reset.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/css/common-ui.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/fonts/flowfont/flowfont.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/assets/font-awesome/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/css/message-pane.css" type="text/css" />
<link rel="stylesheet" href="<%= contextPath %>/nifi/css/message-page.css" type="text/css" />
</head>
<body class="message-pane">

View File

@ -86,15 +86,15 @@
// handle logout
$('#user-logout').on('click', function () {
nfStorage.removeItem('jwt');
window.location = '/nifi/login';
window.location = '../nifi/login';
});
// handle home
$('#user-home').on('click', function () {
if (top !== window) {
parent.window.location = '/nifi';
parent.window.location = '../nifi';
} else {
window.location = '/nifi';
window.location = '../nifi';
}
});
});

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>CreateHadoopSequenceFile</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>JMSConnectionFactoryProvider</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeJMS</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PublishJMS</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PublishKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PublishKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>GetKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PutKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ConsumeKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PublishKafka</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>ConvertAvroSchema</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>SiteToSiteProvenanceReportingTask</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PutSlack</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>GetSNMP</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>SetSNMP</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>PutSolrContentStream</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>SpringContextProcessor</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>DebugFlow</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>EncryptContent</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>EvaluateJsonPath</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>EvaluateXQuery</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css"
<link rel="stylesheet" href="../../../../../css/component-usage.css"
type="text/css" />
</head>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>HandleHttpRequest</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>HandleHttpResponse</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>IdentifyMimeType</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>JoltTransformJSON</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -18,14 +18,14 @@
<meta charset="utf-8" />
<title>PartitionRecord</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>
<p>
PartitionRecord allows the user to separate out records in a FlowFile such that each outgoing FlowFile
consists only of records that are "alike." To define what it means for two records to be alike, the Processor
makes use of NiFi's <a href="/nifi-docs/html/record-path-guide.html">RecordPath</a> DSL.
makes use of NiFi's <a href="../../../../../html/record-path-guide.html">RecordPath</a> DSL.
</p>
<p>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>QueryRecord</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>RouteOnAttribute</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>TailFile</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,12 +18,12 @@
<meta charset="utf-8" />
<title>UpdateRecord</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>
<p>
UpdateRecord makes use of the NiFi <a href="/nifi-docs/html/record-path-guide.html">
UpdateRecord makes use of the NiFi <a href="../../../../../html/record-path-guide.html">
RecordPath Domain-Specific Language (DSL)</a> to allow the user
to indicate which field(s) in the Record should be updated. Users do this by adding a User-defined
Property to the Processor's configuration. The name of the User-defined Property must be the
@ -47,7 +47,7 @@
match will be updated. If the replacement value is itself a RecordPath that does not match, then a
<code>null</code> value will be set for the field. For instances where this is not the desired behavior,
RecordPath predicates can be used to filter the fields that match so that no fields will be selected.
See <a href="/nifi-docs/html/record-path-guide.html#predicates">RecordPath Predicates</a> for more information.
See <a href="../../../../../html/record-path-guide.html#predicates">RecordPath Predicates</a> for more information.
</p>
<p>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>ValidateCsv</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>ControllerStatusReportingTask</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8" />
<title>StandardGangliaReporter</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>IPLookupService</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>CSVReader</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>GrokReader</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>JsonPathReader</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -17,7 +17,7 @@
<head>
<meta charset="utf-8"/>
<title>JsonTreeReader</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css"/>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>UpdateAttribute</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>

View File

@ -18,7 +18,7 @@
<meta charset="utf-8" />
<title>ParseEvtx</title>
<link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" />
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>