-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #236
- Loading branch information
Showing
36 changed files
with
338 additions
and
44 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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/io/tarantool/driver/api/space/options/OperationWithFieldsOptions.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,18 @@ | ||
package io.tarantool.driver.api.space.options; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Base interface for all operation options that may have a configurable return. | ||
* | ||
* @author Artyom Dubinin | ||
*/ | ||
public interface OperationWithFieldsOptions extends OperationWithTimeoutOptions { | ||
/** | ||
* Return list of fields. | ||
* | ||
* @return timeout, in milliseconds. | ||
*/ | ||
Optional<List> getFields(); | ||
} |
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
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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/io/tarantool/driver/api/space/options/proxy/ProxyReturnOptions.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,36 @@ | ||
package io.tarantool.driver.api.space.options.proxy; | ||
|
||
import io.tarantool.driver.api.space.options.OperationWithFieldsOptions; | ||
import io.tarantool.driver.api.space.options.OperationWithTimeoutOptions; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Represent options for functions which return values | ||
* | ||
* @author Alexey Kuzin | ||
* @author Artyom Dubinin | ||
*/ | ||
abstract class ProxyReturnOptions<B extends ProxyReturnOptions<B>> extends ProxyBaseOptions<B> | ||
implements OperationWithFieldsOptions { | ||
|
||
public static final String FIELDS = "fields"; | ||
|
||
/** TODO: | ||
* Specifies timeout for waiting for a server response for the operation. | ||
* Configured request timeout for that client will be used by default. | ||
* | ||
* @param fields request timeout, in milliseconds | ||
* @return this options instance | ||
*/ | ||
public B withFields(List<String> fields) { | ||
addOption(FIELDS, fields); | ||
return self(); | ||
} | ||
|
||
@Override | ||
public Optional<List> getFields() { | ||
return getOption(FIELDS, List.class); | ||
} | ||
} |
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
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
48 changes: 48 additions & 0 deletions
48
src/main/java/io/tarantool/driver/core/proxy/CRUDReturnOptions.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,48 @@ | ||
package io.tarantool.driver.core.proxy; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* This class is not part of the public API. | ||
* <p> | ||
* Represent options for cluster proxy operations which returns fields | ||
* | ||
* @author Alexey Kuzin | ||
* @author Artyom Dubinin | ||
*/ | ||
class CRUDReturnOptions extends CRUDBaseOptions { | ||
|
||
public static final String FIELDS = "fields"; | ||
|
||
protected <O extends CRUDReturnOptions, B extends AbstractBuilder<O, B>> | ||
CRUDReturnOptions(CRUDReturnOptions.AbstractBuilder<O, B> builder) { | ||
super(builder); | ||
|
||
addOption(FIELDS, builder.fields); | ||
} | ||
|
||
protected abstract static | ||
class AbstractBuilder<O extends CRUDReturnOptions, B extends AbstractBuilder<O, B>> | ||
extends CRUDBaseOptions.AbstractBuilder<O, B> { | ||
private Optional<List> fields = Optional.empty(); | ||
|
||
public B withFields(Optional<List> fields) { | ||
this.fields = fields; | ||
return self(); | ||
} | ||
} | ||
|
||
protected static final class Builder extends AbstractBuilder<CRUDReturnOptions, Builder> { | ||
|
||
@Override | ||
CRUDReturnOptions.Builder self() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public CRUDReturnOptions build() { | ||
return new CRUDReturnOptions(this); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.