Class QueryValve

java.lang.Object
com.jcabi.dynamo.QueryValve
All Implemented Interfaces:
Valve

@Immutable @Loggable(1) public final class QueryValve extends Object implements Valve
Query-based valve.
Since:
0.1
  • Constructor Details

    • QueryValve

      public QueryValve()
      Public ctor.
  • Method Details

    • fetch

      public Dosage fetch(Credentials credentials, String table, Map<String,software.amazon.awssdk.services.dynamodb.model.Condition> conditions, Collection<String> keys) throws IOException
      Description copied from interface: Valve
      Fetch the first dosage.
      Specified by:
      fetch in interface Valve
      Parameters:
      credentials - Credentials to AWS
      table - Table name
      conditions - Conditions
      keys - Keys of the table
      Returns:
      Dosage
      Throws:
      IOException - In case of DynamoDB failure
    • count

      public int count(Credentials credentials, String table, Map<String,software.amazon.awssdk.services.dynamodb.model.Condition> conditions) throws IOException
      Description copied from interface: Valve
      Count items.
      Specified by:
      count in interface Valve
      Parameters:
      credentials - Credentials to AWS
      table - Table name
      conditions - 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.consistentRead()
      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.indexName()
      Suppressed Checkstyle violations:
      AvoidDuplicateLiterals (5 line)
    • withSelect

      public QueryValve withSelect(software.amazon.awssdk.services.dynamodb.model.Select slct)
      With attributes to select.
      Parameters:
      slct - Select to use
      Returns:
      New query valve
      Since:
      0.10.2
      See Also:
      • QueryRequest.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.limit()
      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.scanIndexForward()
      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.attributesToGet()
      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.attributesToGet()
      Suppressed Checkstyle violations:
      AvoidDuplicateLiterals (5 line)