-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SocketConfig and BlockedServerTests (#73)
* add SocketConfig and BlockedServerTests * add missing license headers * remove AssertDoesNotThrow from TestServer.close eventLoopThread.join()
- Loading branch information
Showing
15 changed files
with
664 additions
and
36 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/teragrep/rlp_01/client/RenewableRelpConnection.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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/teragrep/rlp_01/client/SSLContextSupplier.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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/teragrep/rlp_01/client/SSLContextSupplierKeystore.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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/teragrep/rlp_01/client/SSLContextSupplierStub.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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/teragrep/rlp_01/client/SocketConfig.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,24 @@ | ||
/* | ||
Java Reliable Event Logging Protocol Library RLP-01 | ||
Copyright (C) 2021-2024 Suomen Kanuuna Oy | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.teragrep.rlp_01.client; | ||
|
||
public interface SocketConfig { | ||
int readTimeout(); | ||
int writeTimeout(); | ||
int connectTimeout(); | ||
boolean keepAlive(); | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/teragrep/rlp_01/client/SocketConfigDefault.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,39 @@ | ||
/* | ||
Java Reliable Event Logging Protocol Library RLP-01 | ||
Copyright (C) 2021-2024 Suomen Kanuuna Oy | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.teragrep.rlp_01.client; | ||
|
||
public class SocketConfigDefault implements SocketConfig { | ||
@Override | ||
public int readTimeout() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int writeTimeout() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int connectTimeout() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean keepAlive() { | ||
return false; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/com/teragrep/rlp_01/client/SocketConfigImpl.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,51 @@ | ||
/* | ||
Java Reliable Event Logging Protocol Library RLP-01 | ||
Copyright (C) 2021-2024 Suomen Kanuuna Oy | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.teragrep.rlp_01.client; | ||
|
||
public class SocketConfigImpl implements SocketConfig { | ||
private final int readTimeout; | ||
private final int writeTimeout; | ||
private final int connectTimeout; | ||
private final boolean keepAlive; | ||
|
||
public SocketConfigImpl(int readTimeout, int writeTimeout, int connectTimeout, boolean keepAlive) { | ||
this.readTimeout = readTimeout; | ||
this.writeTimeout = writeTimeout; | ||
this.connectTimeout = connectTimeout; | ||
this.keepAlive = keepAlive; | ||
} | ||
|
||
@Override | ||
public int readTimeout() { | ||
return readTimeout; | ||
} | ||
|
||
@Override | ||
public int writeTimeout() { | ||
return writeTimeout; | ||
} | ||
|
||
@Override | ||
public int connectTimeout() { | ||
return connectTimeout; | ||
} | ||
|
||
@Override | ||
public boolean keepAlive() { | ||
return keepAlive; | ||
} | ||
} |
Oops, something went wrong.