Skip to content

Eclipse formatter changes to master #1614

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 1 commit 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 @@ -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 @@ -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 @@ -59,7 +59,8 @@ public String getUserId() {
}

public String getTimeOfPerformedAction() {
return LocalDateTime.now().toString();
return LocalDateTime.now()
.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

public enum ConfigurationChangeActions {

CONFIGURATION_CREATE("configuration-create"),
CONFIGURATION_UPDATE("configuration-update"),
CONFIGURATION_DELETE("configuration-delete");
CONFIGURATION_CREATE("configuration-create"), CONFIGURATION_UPDATE("configuration-update"), CONFIGURATION_DELETE(
"configuration-delete");

private final String configurationAction;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ public void releaseClient(String userName, String spaceGuid) {

private CloudControllerClient getClientFromCacheWithNoCorrelation(String userName, String spaceId) {
String key = getKey(spaceId, userName);
return clients.computeIfAbsent(key,
() -> clientFactory.createClient(tokenService.getToken(userName), spaceId, null));
return clients.computeIfAbsent(key, () -> clientFactory.createClient(tokenService.getToken(userName), spaceId, null));
}

private CloudControllerClient getClientFromCache(String userName, String spaceId, String correlationId) {
String key = getKey(spaceId, userName);
return clients.computeIfAbsent(key,
() -> clientFactory.createClient(tokenService.getToken(userName), spaceId, correlationId));
return clients.computeIfAbsent(key, () -> clientFactory.createClient(tokenService.getToken(userName), spaceId, correlationId));
}

private String getKey(String spaceGuid, String username) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public OAuth2AccessTokenWithAdditionalInfo getToken() {
.plus(120, ChronoUnit.SECONDS))) {
TokenProperties tokenProperties = TokenProperties.fromToken(token);
token = tokenService.getToken(tokenProperties.getUserName());
LOGGER.info(MessageFormat.format(Messages.RETRIEVED_TOKEN_FOR_USER_WITH_GUID_0_WITH_EXPIRATION_TIME_1, tokenProperties.getUserId(),
token.getOAuth2AccessToken()
.getExpiresAt()));
LOGGER.info(MessageFormat.format(Messages.RETRIEVED_TOKEN_FOR_USER_WITH_GUID_0_WITH_EXPIRATION_TIME_1,
tokenProperties.getUserId(), token.getOAuth2AccessToken()
.getExpiresAt()));
}
return token;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ private boolean hasExecuteAppParameter(CloudApplication app, Map<String, String>

private boolean isStarted(CloudApplication app, InstancesInfo appInstances, long runningInstancesCount) {
return runningInstancesCount == appInstances.getInstances()
.size() && runningInstancesCount > 0 && app.getState()
.equals(CloudApplication.State.STARTED);
.size()
&& runningInstancesCount > 0 && app.getState()
.equals(CloudApplication.State.STARTED);
}

private boolean isStopped(CloudApplication app, long runningInstancesCount) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class CloudEntityResourceMapper {

private static final Logger LOGGER = LoggerFactory.getLogger(CloudEntityResourceMapper.class);

@SuppressWarnings("unchecked")
public String getRelatedObjectGuid(Map<String, Object> resource, String relationshipName) {
var relationships = (Map<String, Object>) resource.get("relationships");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public FinalizingBuilder hasValueOrIsntPresent(String value) {
if (StringUtils.isEmpty(value)) {
return doesNotExist();
}

return hasValue(value);
}

public FinalizingBuilder hasValue(String value) {
public FinalizingBuilder hasValue(String value) {
MtaMetadataCriteriaValidator.validateLabelValue(value);
return completeQuery(label + "=" + value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public interface MtaMetadataEntityCollector<T extends CloudEntity> {

List<T> collect(CloudControllerClient client, MtaMetadataCriteria criteria);

List<T> collectRequiredDataOnly(CloudControllerClient client, MtaMetadataCriteria criteria);

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MtaMetadataServiceCollector implements MtaMetadataEntityCollector<C
public List<CloudServiceInstance> collect(CloudControllerClient client, MtaMetadataCriteria criteria) {
return client.getServiceInstancesByMetadataLabelSelector(criteria.get());
}

@Override
public List<CloudServiceInstance> collectRequiredDataOnly(CloudControllerClient client, MtaMetadataCriteria criteria) {
return client.getServiceInstancesWithoutAuxiliaryContentByMetadataLabelSelector(criteria.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ private boolean areModuleDependenciesResolvable(Module module, Set<String> modul
return true;
}
return moduleDependencies.stream()
.allMatch(dependency -> isModuleDependencyResolvable(moduleNamesForDeployment, module.getName(), dependency));
.allMatch(dependency -> isModuleDependencyResolvable(moduleNamesForDeployment, module.getName(),
dependency));
}

private boolean isModuleDependencyResolvable(Set<String> moduleNamesForDeployment, String moduleWithDependency, String dependencyModule) {
private boolean isModuleDependencyResolvable(Set<String> moduleNamesForDeployment, String moduleWithDependency,
String dependencyModule) {
if (moduleNamesForDeployment.contains(dependencyModule)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public ServiceKeysCloudModelBuilder(DeploymentDescriptor deploymentDescriptor, S

public Map<String, List<CloudServiceKey>> build() {
return descriptor.getResources()
.stream()
.filter(CloudModelBuilderUtil::isService)
.collect(Collectors.toMap(Resource::getName, this::getServiceKeysForService));
.stream()
.filter(CloudModelBuilderUtil::isService)
.collect(Collectors.toMap(Resource::getName, this::getServiceKeysForService));
}

protected List<CloudServiceKey> getServiceKeysForService(Resource resource) {
Expand Down Expand Up @@ -79,8 +79,9 @@ protected List<Map<String, Object>> getServiceKeysMaps(Resource resource) {

protected String getInvalidServiceKeysErrorMessage(String serviceName, Object serviceConfig) {
return MessageFormat.format(org.cloudfoundry.multiapps.mta.Messages.INVALID_TYPE_FOR_KEY,
org.cloudfoundry.multiapps.mta.util.NameUtil.getPrefixedName(serviceName, SupportedParameters.SERVICE_KEYS), Map.class.getSimpleName(),
serviceConfig.getClass()
.getSimpleName());
org.cloudfoundry.multiapps.mta.util.NameUtil.getPrefixedName(serviceName,
SupportedParameters.SERVICE_KEYS),
Map.class.getSimpleName(), serviceConfig.getClass()
.getSimpleName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public List<String> getAllApplicationServices(Module module) {
@Override
protected List<String> getApplicationServices(Module module) {
return getApplicationServices(module, (resource, type) -> filterExistingServicesRule(resource, type)
&& onlyActiveServicesRule(resource, type));
&& onlyActiveServicesRule(resource, type));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public ServiceKeysCloudModelBuilder(DeploymentDescriptor deploymentDescriptor, S
@Override
public Map<String, List<CloudServiceKey>> build() {
return descriptor.getResources()
.stream()
.filter(CloudModelBuilderUtil::isService)
.filter(Resource::isActive)
.collect(Collectors.toMap(Resource::getName, this::getServiceKeysForService));
.stream()
.filter(CloudModelBuilderUtil::isService)
.filter(Resource::isActive)
.collect(Collectors.toMap(Resource::getName, this::getServiceKeysForService));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void init() {

private Map<String, String> getEntriesWithAttribute(String attributeName) {
Map<String, String> result = new HashMap<>();
processEntries(attributeName, (attributeValue, fileName) -> fillMapWithEntries(attributeValue, fileName, result), manifest.getEntries());
processEntries(attributeName, (attributeValue, fileName) -> fillMapWithEntries(attributeValue, fileName, result),
manifest.getEntries());
return result;
}

Expand Down Expand Up @@ -96,7 +97,8 @@ private Map<String, Attributes> getAttributesWithJSONContentType() {

private Map<String, List<String>> getFilesWithEntityList(String attributeName, Map<String, Attributes> manifestEntries) {
Map<String, List<String>> result = new HashMap<>();
processEntries(attributeName, (attributeValue, fileName) -> fillMapFilesWithEntityList(attributeValue, fileName, result), manifestEntries);
processEntries(attributeName, (attributeValue, fileName) -> fillMapFilesWithEntityList(attributeValue, fileName, result),
manifestEntries);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Object visit(String key, String value) {
String relationshipName = DynamicParameterUtil.getRelationshipName(value);
String parameterName = DynamicParameterUtil.getParameterName(value);
DynamicResolvableParameter dynamicResolvableParameter = dynamicResolvableParametersHelper.findDynamicResolvableParameter(parameterName,
relationshipName);
relationshipName);
if (dynamicResolvableParameter != null && dynamicResolvableParameter.getValue() != null) {
return dynamicResolvableParameter.getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,18 @@ public class ApplicationConfiguration {
public static final long DEFAULT_MAX_MANIFEST_SIZE = 1024 * 1024L; // 1MB
public static final long DEFAULT_MAX_RESOURCE_FILE_SIZE = 1024 * 1024 * 1024L; // 1GB

public static final long DEFAULT_CFG_MAX_RESOLVED_EXTERNAL_CONTENT_SIZE = 1024 * 1024 * 10L; // 10MB
public static final long DEFAULT_CFG_MAX_RESOLVED_EXTERNAL_CONTENT_SIZE = 1024 * 1024 * 10L; // 10MB

public static final Boolean DEFAULT_USE_XS_AUDIT_LOGGING = true;
public static final String DEFAULT_SPACE_GUID = "";
public static final Boolean DEFAULT_BASIC_AUTH_ENABLED = false;
public static final Integer DEFAULT_DB_CONNECTION_THREADS = 30;
public static final String DEFAULT_CRON_EXPRESSION_FOR_OLD_DATA = "0 0 0/6 * * ?"; // every 6 hours
public static final String DEFAULT_EXECUTION_TIME_FOR_FINISHED_PROCESSES = Long.toString(TimeUnit.HOURS.toMillis(2)); /*every 2 hours
after an
instance starts*/
public static final String DEFAULT_EXECUTION_TIME_FOR_FINISHED_PROCESSES = Long.toString(TimeUnit.HOURS.toMillis(2)); /*
* every 2 hours
* after an
* instance starts
*/
public static final long DEFAULT_MAX_TTL_FOR_OLD_DATA = TimeUnit.DAYS.toSeconds(5); // 5 days
public static final Integer DEFAULT_STEP_POLLING_INTERVAL_IN_SECONDS = 5;
public static final Boolean DEFAULT_SKIP_SSL_VALIDATION = false;
Expand Down Expand Up @@ -906,14 +908,10 @@ private String getGlobalConfigSpaceFromEnvironment() {

private HealthCheckConfiguration getHealthCheckConfigurationFromEnvironment() {
HealthCheckConfiguration healthCheckConfigurationFromEnvironment = ImmutableHealthCheckConfiguration.builder()
.spaceId(
getHealthCheckSpaceGuidFromEnvironment())
.mtaId(
getHealthCheckMtaIdFromEnvironment())
.userName(
getHealthCheckUserFromEnvironment())
.timeRangeInSeconds(
getHealthCheckTimeRangeFromEnvironment())
.spaceId(getHealthCheckSpaceGuidFromEnvironment())
.mtaId(getHealthCheckMtaIdFromEnvironment())
.userName(getHealthCheckUserFromEnvironment())
.timeRangeInSeconds(getHealthCheckTimeRangeFromEnvironment())
.build();
return healthCheckConfigurationFromEnvironment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ public static String computeNamespacedNameWithLength(String name, String namespa

private static String getNameWithNamespaceSuffix(String name, String namespace, int maxLength) {
String namespaceSuffix = getNamespaceSuffix(namespace);
String shortenedName = getNameWithProperLength(name, calculateNameLengthWithoutNamespaceAndBlueGreenSuffix(namespaceSuffix, maxLength));
String shortenedName = getNameWithProperLength(name,
calculateNameLengthWithoutNamespaceAndBlueGreenSuffix(namespaceSuffix, maxLength));

return correctNameSuffix(shortenedName, name, namespaceSuffix);
}

private static int calculateNameLengthWithoutNamespaceAndBlueGreenSuffix(String namespaceSuffix, int maxLengthWithSuffix) {
//Here we use the "green" suffix because it is the longest out of all
// Here we use the "green" suffix because it is the longest out of all
return maxLengthWithSuffix - (namespaceSuffix.length() + SystemParameters.GREEN_HOST_SUFFIX.length());
}

Expand Down Expand Up @@ -120,6 +121,7 @@ public static String computeUserNamespaceWithSystemNamespace(String systemNamesp
}
return systemNamespace;
}

private static String getShortenedName(String name, int maxLength) {
String nameHashCode = getHashCodeAsHexString(name);
if (maxLength < nameHashCode.length()) {
Expand Down
Loading