-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename IggyClient interface, add initial builder structure
- Loading branch information
1 parent
97ca845
commit 7eb96cf
Showing
29 changed files
with
138 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
package rs.iggy; | ||
|
||
public class Iggy { | ||
import rs.iggy.clients.blocking.IggyClientBuilder; | ||
|
||
public final class Iggy { | ||
|
||
private Iggy() { | ||
} | ||
|
||
public static IggyClientBuilder clientBuilder() { | ||
return new IggyClientBuilder(); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
java-sdk/src/main/java/rs/iggy/clients/blocking/IggyBaseClient.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,23 @@ | ||
package rs.iggy.clients.blocking; | ||
|
||
public interface IggyBaseClient { | ||
|
||
SystemClient system(); | ||
|
||
StreamsClient streams(); | ||
|
||
UsersClient users(); | ||
|
||
TopicsClient topics(); | ||
|
||
PartitionsClient partitions(); | ||
|
||
ConsumerGroupsClient consumerGroups(); | ||
|
||
ConsumerOffsetsClient consumerOffsets(); | ||
|
||
MessagesClient messages(); | ||
|
||
PersonalAccessTokensClient personalAccessTokens(); | ||
|
||
} |
24 changes: 8 additions & 16 deletions
24
java-sdk/src/main/java/rs/iggy/clients/blocking/IggyClient.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 |
---|---|---|
@@ -1,23 +1,15 @@ | ||
package rs.iggy.clients.blocking; | ||
|
||
public interface IggyClient { | ||
public class IggyClient { | ||
|
||
SystemClient system(); | ||
private final IggyBaseClient baseClient; | ||
|
||
StreamsClient streams(); | ||
public IggyClient(IggyBaseClient baseClient) { | ||
this.baseClient = baseClient; | ||
} | ||
|
||
UsersClient users(); | ||
|
||
TopicsClient topics(); | ||
|
||
PartitionsClient partitions(); | ||
|
||
ConsumerGroupsClient consumerGroups(); | ||
|
||
ConsumerOffsetsClient consumerOffsets(); | ||
|
||
MessagesClient messages(); | ||
|
||
PersonalAccessTokensClient personalAccessTokens(); | ||
public IggyBaseClient getBaseClient() { | ||
return baseClient; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
java-sdk/src/main/java/rs/iggy/clients/blocking/IggyClientBuilder.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,19 @@ | ||
package rs.iggy.clients.blocking; | ||
|
||
public class IggyClientBuilder { | ||
|
||
private IggyBaseClient client; | ||
|
||
public IggyClientBuilder withBaseClient(IggyBaseClient client) { | ||
this.client = client; | ||
return this; | ||
} | ||
|
||
public IggyClient build() { | ||
if (client == null) { | ||
throw new IllegalArgumentException("Base client not provided"); | ||
} | ||
return new IggyClient(client); | ||
} | ||
|
||
} |
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
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,20 @@ | ||
package rs.iggy; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import rs.iggy.clients.blocking.http.IggyHttpClient; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class IggyTest { | ||
|
||
@Test | ||
void test() { | ||
var baseClient = new IggyHttpClient("http://localhost:8080"); | ||
|
||
var client = Iggy.clientBuilder() | ||
.withBaseClient(baseClient) | ||
.build(); | ||
|
||
assertThat(client).isNotNull(); | ||
} | ||
|
||
} |
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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/ConsumerGroupsHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/ConsumerOffsetsHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/MessagesHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/PartitionsHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/PersonalAccessTokensHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/StreamHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/SystemHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/TopicsHttpClientTest.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
4 changes: 2 additions & 2 deletions
4
java-sdk/src/test/java/rs/iggy/clients/blocking/http/UsersHttpClientTest.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
Oops, something went wrong.