Skip to content

Commit

Permalink
apply spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Shoham Elias <[email protected]>
  • Loading branch information
shohamazon committed Dec 22, 2024
1 parent 7ed7990 commit d897574
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 133 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.api.models.configuration;

import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.api.models.configuration;

import lombok.Getter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;


@Getter
@SuperBuilder
@ToString
public class AdvancedGlideClientConfiguration extends AdvancedBaseClientConfiguration {


}
public class AdvancedGlideClientConfiguration extends AdvancedBaseClientConfiguration {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.api.models.configuration;

import lombok.Getter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;


@Getter
@SuperBuilder
@ToString
public class AdvancedGlideClusterClientConfiguration extends AdvancedBaseClientConfiguration{

}
public class AdvancedGlideClusterClientConfiguration extends AdvancedBaseClientConfiguration {}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public abstract class BaseClientConfiguration {
*/
private final Integer requestTimeout;


/**
* Client name to be used for the client. Will be used with CLIENT SETNAME command during
* connection establishment.
Expand Down
26 changes: 15 additions & 11 deletions java/client/src/main/java/glide/managers/ConnectionManager.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.managers;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;

import com.google.protobuf.ByteString;

import connection_request.ConnectionRequestOuterClass;
import connection_request.ConnectionRequestOuterClass.AuthenticationInfo;
import connection_request.ConnectionRequestOuterClass.ConnectionRequest;
Expand All @@ -21,6 +17,8 @@
import glide.api.models.exceptions.ClosingException;
import glide.api.models.exceptions.ConfigurationError;
import glide.connectors.handlers.ChannelHandler;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import lombok.RequiredArgsConstructor;
import response.ResponseOuterClass.Response;

Expand Down Expand Up @@ -72,7 +70,8 @@ private Response exceptionHandler(Throwable e) {
* @param configuration Connection Request Configuration
* @return ConnectionRequest protobuf message
*/
private ConnectionRequest createConnectionRequest(BaseClientConfiguration configuration) { // shoham
private ConnectionRequest createConnectionRequest(
BaseClientConfiguration configuration) { // shoham
if (configuration instanceof GlideClusterClientConfiguration) {
return setupConnectionRequestBuilderGlideClusterClient(
(GlideClusterClientConfiguration) configuration)
Expand Down Expand Up @@ -174,15 +173,18 @@ private ConnectionRequest.Builder setupConnectionRequestBuilderGlideClient(
connectionRequestBuilder.setPubsubSubscriptions(subscriptionsBuilder.build());
}

if (configuration.getAdvancedConfiguration()!=null){
connectionRequestBuilder = setupConnectionRequestBuilderAdvancedBaseConfiguration(connectionRequestBuilder, configuration);
if (configuration.getAdvancedConfiguration() != null) {
connectionRequestBuilder =
setupConnectionRequestBuilderAdvancedBaseConfiguration(
connectionRequestBuilder, configuration.getAdvancedConfiguration());
}

return connectionRequestBuilder;
}


private ConnectionRequest.Builder setupConnectionRequestBuilderAdvancedBaseConfiguration(ConnectionRequest.Builder connectionRequestBuilder, AdvancedBaseClientConfiguration configuration){
private ConnectionRequest.Builder setupConnectionRequestBuilderAdvancedBaseConfiguration(
ConnectionRequest.Builder connectionRequestBuilder,
AdvancedBaseClientConfiguration configuration) {
if (configuration.getConnectionTimeout() != null) {
connectionRequestBuilder.setConnectionTimeout(configuration.getConnectionTimeout());
}
Expand Down Expand Up @@ -215,8 +217,10 @@ private ConnectionRequest.Builder setupConnectionRequestBuilderGlideClusterClien
connectionRequestBuilder.setPubsubSubscriptions(subscriptionsBuilder.build());
}

if (configuration.getAdvancedConfiguration()!=null){
connectionRequestBuilder = setupConnectionRequestBuilderAdvancedBaseConfiguration(connectionRequestBuilder, configuration);
if (configuration.getAdvancedConfiguration() != null) {
connectionRequestBuilder =
setupConnectionRequestBuilderAdvancedBaseConfiguration(
connectionRequestBuilder, configuration.getAdvancedConfiguration());
}

return connectionRequestBuilder;
Expand Down
Loading

0 comments on commit d897574

Please sign in to comment.