Class QueryValve

  • All Implemented Interfaces:
    Valve

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

      • QueryValve

        public QueryValve()
        Public ctor.
    • 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 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,​com.amazonaws.services.dynamodbv2.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.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)