Class ReValve

  • All Implemented Interfaces:
    Valve

    @Immutable
    @Loggable(1)
    public final class ReValve
    extends Object
    implements Valve
    Valve that retries on failure.
    Since:
    0.9
    • Constructor Detail

      • ReValve

        public ReValve​(Valve valve)
        Public ctor.
        Parameters:
        valve - Origin valve
    • Method Detail

      • fetch

        @RetryOnFailure(verbose=false,
                        delay=5L,
                        unit=SECONDS)
        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

        @RetryOnFailure(verbose=false,
                        delay=5L,
                        unit=SECONDS)
        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