Package com.jcabi.dynamo
Class QueryValve
- java.lang.Object
-
- com.jcabi.dynamo.QueryValve
-
-
Constructor Summary
Constructors Constructor Description QueryValve()
Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
count(Credentials credentials, String table, Map<String,com.amazonaws.services.dynamodbv2.model.Condition> conditions)
Count items.Dosage
fetch(Credentials credentials, String table, Map<String,com.amazonaws.services.dynamodbv2.model.Condition> conditions, Collection<String> keys)
Fetch the first dosage.QueryValve
withAttributesToGet(String... names)
With these extra attributes to pre-fetch.QueryValve
withAttributeToGet(String name)
With this extra attribute to pre-fetch.QueryValve
withConsistentRead(boolean cnst)
With consistent read.QueryValve
withIndexName(String idx)
With index name.QueryValve
withLimit(int lmt)
With given limit.QueryValve
withScanIndexForward(boolean fwd)
With scan index forward flag.QueryValve
withSelect(com.amazonaws.services.dynamodbv2.model.Select slct)
With attributes to select.
-
-
-
Method Detail
-
fetch
public Dosage fetch(Credentials credentials, String table, Map<String,com.amazonaws.services.dynamodbv2.model.Condition> conditions, Collection<String> keys) throws IOException
Description copied from interface:Valve
Fetch the first dosage.- Specified by:
fetch
in interfaceValve
- Parameters:
credentials
- Credentials to AWStable
- Table nameconditions
- Conditionskeys
- Keys of the table- Returns:
- Dosage
- Throws:
IOException
- In case of DynamoDB failure
-
count
public int count(Credentials credentials, String table, Map<String,com.amazonaws.services.dynamodbv2.model.Condition> conditions) throws IOException
Description copied from interface:Valve
Count items.- Specified by:
count
in interfaceValve
- Parameters:
credentials
- Credentials to AWStable
- Table nameconditions
- Conditions- Returns:
- Total count of the
- Throws:
IOException
- In case of DynamoDB failure
-
withConsistentRead
public QueryValve withConsistentRead(boolean cnst)
With consistent read.- Parameters:
cnst
- Consistent read- Returns:
- New query valve
- Since:
- 0.12
- See Also:
QueryRequest.withConsistentRead(Boolean)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withIndexName
public QueryValve withIndexName(String idx)
With index name.- Parameters:
idx
- Index name- Returns:
- New query valve
- Since:
- 0.10.2
- See Also:
QueryRequest.withIndexName(String)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withSelect
public QueryValve withSelect(com.amazonaws.services.dynamodbv2.model.Select slct)
With attributes to select.- Parameters:
slct
- Select to use- Returns:
- New query valve
- Since:
- 0.10.2
- See Also:
QueryRequest.withSelect(Select)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withLimit
public QueryValve withLimit(int lmt)
With given limit.- Parameters:
lmt
- Limit to use- Returns:
- New query valve
- See Also:
QueryRequest.withLimit(Integer)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withScanIndexForward
public QueryValve withScanIndexForward(boolean fwd)
With scan index forward flag.- Parameters:
fwd
- Forward flag- Returns:
- New query valve
- See Also:
QueryRequest.withScanIndexForward(Boolean)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withAttributeToGet
public QueryValve withAttributeToGet(String name)
With this extra attribute to pre-fetch.- Parameters:
name
- Name of attribute to pre-load- Returns:
- New query valve
- See Also:
QueryRequest.withAttributesToGet(Collection)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
withAttributesToGet
public QueryValve withAttributesToGet(String... names)
With these extra attributes to pre-fetch.- Parameters:
names
- Name of attributes to pre-load- Returns:
- New query valve
- See Also:
QueryRequest.withAttributesToGet(Collection)
- Suppressed Checkstyle violations:
- AvoidDuplicateLiterals (5 line)
-
-