Skip to content

Intellij formatter changes to master #1615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private Resources() {
public static final String SPACE_V2 = Resources.ROOT_V2 + "/spaces/{" + PathVariables.SPACE_GUID + "}";
public static final String MTAS_V2 = SPACE_V2 + "/mtas";
}

public static class Endpoints {

private Endpoints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ public interface FileUrl {
@Value.Parameter
@JsonProperty("credentials")
UserCredentials getUserCredentials();
//this could potentially contain a TLS certificate as well, if the remote endpoint is a custom registry/repository
// this could potentially contain a TLS certificate as well, if the remote endpoint is a custom registry/repository
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface Metadata {
@ApiModelProperty
@JsonProperty("version")
String getVersion();

@Nullable
@ApiModelProperty
@JsonProperty("namespace")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.cloudfoundry.multiapps.controller.api.model.parameters;

/**
* Validates and converts the raw parameter value to its appropriate type. The result is then used as input for starting a Flowable process.
*
* Validates and converts the raw parameter value to its appropriate type. The result is then used as input for starting a Flowable
* process.
*/
public interface ParameterConverter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CsrfTokenApi {
@GetMapping
@ApiOperation(value = "", notes = "Retrieves a csrf-token header ", authorizations = { @Authorization(value = "oauth2", scopes = {

}) }, tags = {})
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 204, message = "No Content") })
public ResponseEntity<Void> getCsrfToken() {
return delegate.getCsrfToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class FilesApi {
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = FileMetadata.class, responseContainer = "List") })
public ResponseEntity<List<FileMetadata>>
getFiles(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "Filter mtas by namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace) {
getFiles(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "Filter mtas by namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace) {
return delegate.getFiles(spaceGuid, namespace);
}

Expand All @@ -57,9 +57,9 @@ public class FilesApi {
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 201, message = "Created", response = FileMetadata.class) })
public ResponseEntity<FileMetadata>
uploadFile(MultipartHttpServletRequest request,
@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace) {
uploadFile(MultipartHttpServletRequest request,
@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace) {
return delegate.uploadFile(request, spaceGuid, namespace);
}

Expand All @@ -70,9 +70,9 @@ public class FilesApi {
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 202, message = "Accepted") })
public ResponseEntity<Void>
startUploadFromUrl(@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "URL reference to a remote file") @RequestBody FileUrl fileUrl) {
startUploadFromUrl(@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "URL reference to a remote file") @RequestBody FileUrl fileUrl) {
return delegate.startUploadFromUrl(spaceGuid, namespace, fileUrl);
}

Expand All @@ -84,9 +84,9 @@ public class FilesApi {
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK"),
@ApiResponse(code = 201, message = "Created", response = AsyncUploadResult.class) })
public ResponseEntity<AsyncUploadResult>
getUploadFromUrlJob(@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "ID of the upload job") @PathVariable(PathVariables.JOB_ID) String jobId) {
getUploadFromUrlJob(@ApiParam(value = "GUID of space you wish to deploy in") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "file namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "ID of the upload job") @PathVariable(PathVariables.JOB_ID) String jobId) {
return delegate.getUploadFromUrlJob(spaceGuid, namespace, jobId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ResponseEntity<Mta> getMta(@ApiParam(value = "GUID of space with mtas") @
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Mta.class, responseContainer = "List") })
public ResponseEntity<List<Mta>>
getMtas(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid) {
getMtas(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid) {
return delegate.getMtas(spaceGuid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public ResponseEntity<Void> executeOperationAction(HttpServletRequest request, @
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Operation.class) })
public ResponseEntity<Operation>
getOperation(@PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@PathVariable(PathVariables.OPERATION_ID) String operationId,
@ApiParam(value = "Adds the specified property in the response body ") @RequestParam(name = "embed", required = false) String embed) {
getOperation(@PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@PathVariable(PathVariables.OPERATION_ID) String operationId,
@ApiParam(value = "Adds the specified property in the response body ") @RequestParam(name = "embed", required = false) String embed) {
return delegate.getOperation(spaceGuid, operationId, embed);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public class MtasApiV2 {
}) }, tags = {})
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Mta.class, responseContainer = "List") })
public ResponseEntity<List<Mta>>
getMtas(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "Filter mtas by namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "Filter mtas by name") @RequestParam(name = RequestVariables.MTA_NAME, required = false) String name) {
getMtas(@ApiParam(value = "GUID of space with mtas") @PathVariable(PathVariables.SPACE_GUID) String spaceGuid,
@ApiParam(value = "Filter mtas by namespace") @RequestParam(name = RequestVariables.NAMESPACE, required = false) String namespace,
@ApiParam(value = "Filter mtas by name") @RequestParam(name = RequestVariables.MTA_NAME, required = false) String name) {
return delegate.getMtas(spaceGuid, namespace, name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private HealthCheckInfo(String type, Integer timeout, Integer invocationTimeout,
public static HealthCheckInfo fromStaging(Staging staging) {
var type = staging.getHealthCheckType();
if (type == null) {
type = "port"; //use default health check type https://v3-apidocs.cloudfoundry.org/version/3.119.0/#the-health-check-object
type = "port"; // use default health check type https://v3-apidocs.cloudfoundry.org/version/3.119.0/#the-health-check-object
}
var timeout = staging.getHealthCheckTimeout();
var invocationTimeout = staging.getInvocationTimeout();
Expand Down Expand Up @@ -63,8 +63,7 @@ public boolean equals(Object obj) {
return false;
}
var other = (HealthCheckInfo) obj;
return Objects.equals(getType(), other.getType())
&& Objects.equals(getTimeout(), other.getTimeout())
return Objects.equals(getType(), other.getType()) && Objects.equals(getTimeout(), other.getTimeout())
&& Objects.equals(getInvocationTimeout(), other.getInvocationTimeout())
&& Objects.equals(getHttpEndpoint(), other.getHttpEndpoint());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,16 @@ public ResponseEntity<ApplicationHealthResult> calculateApplicationHealth() {
}
boolean hasIncreasedDbLocks = hasIncreasedLocksCache.getOrRefresh(() -> true);
if (hasIncreasedDbLocks) {
LOGGER.warn(MessageFormat.format(Messages.DETECTED_INCREASED_NUMBER_OF_PROCESSES_WAITING_FOR_LOCKS_FOR_INSTANCE_0_GETTING_THE_LOCKS,
applicationConfiguration.getApplicationInstanceIndex()));
long countOfProcessesWaitingForLocks = resilientOperationExecutor.execute((Supplier<Long>) () -> databaseMonitoringService.getProcessesWaitingForLocks(ApplicationInstanceNameUtil.buildApplicationInstanceTemplate(applicationConfiguration)));
LOGGER.warn(
MessageFormat.format(Messages.DETECTED_INCREASED_NUMBER_OF_PROCESSES_WAITING_FOR_LOCKS_FOR_INSTANCE_0_GETTING_THE_LOCKS,
applicationConfiguration.getApplicationInstanceIndex()));
long countOfProcessesWaitingForLocks = resilientOperationExecutor.execute(
(Supplier<Long>) () -> databaseMonitoringService.getProcessesWaitingForLocks(
ApplicationInstanceNameUtil.buildApplicationInstanceTemplate(applicationConfiguration)));
LOGGER.warn(MessageFormat.format(Messages.DETECTED_INCREASED_NUMBER_OF_PROCESSES_WAITING_FOR_LOCKS_FOR_INSTANCE,
countOfProcessesWaitingForLocks, applicationConfiguration.getApplicationInstanceIndex()));
return ResponseEntity.ok(ImmutableApplicationHealthResult.builder() // TODO: Make this return 503 instead of 200 when the
// detection is trustworthy
// detection is trustworthy
.status(ApplicationHealthResult.Status.DOWN)
.hasIncreasedLocks(true)
.countOfProcessesWaitingForLocks(countOfProcessesWaitingForLocks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ private void deleteObsoleteSamples() {
}

private void takeLocksSample() {
waitingLocksSamples.add(new CachedObject<>(databaseMonitoringService.getProcessesWaitingForLocks(ApplicationInstanceNameUtil.buildApplicationInstanceTemplate(applicationConfiguration)),
waitingLocksSamples.add(new CachedObject<>(databaseMonitoringService.getProcessesWaitingForLocks(
ApplicationInstanceNameUtil.buildApplicationInstanceTemplate(applicationConfiguration)),
MAXIMUM_VALIDITY_OF_LOCKS_SAMPLE_IN_MINUTES));
}

Expand All @@ -76,7 +77,8 @@ public synchronized boolean hasIncreasedDbLocks() {
if (shouldLogValues()) {
LOGGER.info(MessageFormat.format(Messages.VALUES_IN_INSTANCE_IN_THE_WAITING_FOR_LOCKS_SAMPLES,
applicationConfiguration.getApplicationInstanceIndex(), waitingLocksSamples.stream()
.map(CachedObject::get)
.map(
CachedObject::get)
.toList()));
}
return hasIncreasedLocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.context.annotation.Configuration;

import jakarta.inject.Inject;

import javax.sql.DataSource;

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
public interface AuditLoggingFacade {

void logSecurityIncident(AuditLogConfiguration configuration);

void logDataAccessAuditLog(AuditLogConfiguration configuration);

void logConfigurationChangeAuditLog(AuditLogConfiguration configuration, ConfigurationChangeActions configurationAction);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.cloudfoundry.multiapps.controller.core.Messages;
import org.cloudfoundry.multiapps.controller.core.auditlogging.model.AuditLogConfiguration;


public class AuthenticationAuditLog {

private final AuditLoggingFacade auditLoggingFacade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public void logUploadFile(String username, String spaceGuid, FileMetadata fileMe
spaceGuid,
performedAction,
Messages.FILE_UPLOAD_AUDIT_LOG_CONFIG,
createFileMetadataConfigurationIdentifier(fileMetadata)),
createFileMetadataConfigurationIdentifier(
fileMetadata)),
ConfigurationChangeActions.CONFIGURATION_CREATE);
}

Expand All @@ -51,7 +52,8 @@ public void logStartUploadFromUrl(String username, String spaceGuid, String file
spaceGuid,
performedAction,
Messages.FILE_UPLOAD_FROM_URL_AUDIT_LOG_CONFIG,
createAuditLogStartUploadFromUrlConfigurationIdentifier(fileUrl)),
createAuditLogStartUploadFromUrlConfigurationIdentifier(
fileUrl)),
ConfigurationChangeActions.CONFIGURATION_CREATE);
}

Expand All @@ -61,8 +63,9 @@ public void logGetUploadFromUrlJob(String username, String spaceGuid, String nam
spaceGuid,
performedAction,
Messages.UPLOAD_FROM_URL_JOB_INFO_AUDIT_LOG_CONFIG,
createAuditLogGetUploadFromUrlJobConfigurationIdentifier(namespace,
jobId)));
createAuditLogGetUploadFromUrlJobConfigurationIdentifier(
namespace,
jobId)));
}

private Map<String, String> createFileMetadataConfigurationIdentifier(FileMetadata fileMetadata) {
Expand Down
Loading