-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
49 changed files
with
626 additions
and
707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...tor-core/src/main/java/org/eclipse/edc/connector/core/base/OkHttpClientConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.connector.core.base; | ||
|
||
public class OkHttpClientConfiguration { | ||
|
||
private boolean enforceHttps; | ||
private int connectTimeout; | ||
private int readTimeout; | ||
private int sendBufferSize; | ||
private int receiveBufferSize; | ||
|
||
private OkHttpClientConfiguration() { | ||
} | ||
|
||
public boolean isEnforceHttps() { | ||
return enforceHttps; | ||
} | ||
|
||
public int getConnectTimeout() { | ||
return connectTimeout; | ||
} | ||
|
||
public int getReadTimeout() { | ||
return readTimeout; | ||
} | ||
|
||
public int getSendBufferSize() { | ||
return sendBufferSize; | ||
} | ||
|
||
public int getReceiveBufferSize() { | ||
return receiveBufferSize; | ||
} | ||
|
||
public static class Builder { | ||
|
||
private final OkHttpClientConfiguration instance = new OkHttpClientConfiguration(); | ||
|
||
public static Builder newInstance() { | ||
return new Builder(); | ||
} | ||
|
||
private Builder() { | ||
} | ||
|
||
public Builder enforceHttps(boolean enforceHttps) { | ||
instance.enforceHttps = enforceHttps; | ||
return this; | ||
} | ||
|
||
public Builder connectTimeout(int connectTimeout) { | ||
instance.connectTimeout = connectTimeout; | ||
return this; | ||
} | ||
|
||
public Builder readTimeout(int readTimeout) { | ||
instance.readTimeout = readTimeout; | ||
return this; | ||
} | ||
|
||
public Builder sendBufferSize(int sendBufferSize) { | ||
instance.sendBufferSize = sendBufferSize; | ||
return this; | ||
} | ||
|
||
public Builder receiveBufferSize(int receiveBufferSize) { | ||
instance.receiveBufferSize = receiveBufferSize; | ||
return this; | ||
} | ||
|
||
public OkHttpClientConfiguration build() { | ||
return instance; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.