Coverage Report - com.jcabi.dynamo.retry.ReFrame
 
Classes in this File Line Coverage Branch Coverage Complexity
ReFrame
0%
0/26
0%
0/12
1
ReFrame$AjcClosure1
0%
0/1
N/A
1
ReFrame$AjcClosure11
0%
0/1
N/A
1
ReFrame$AjcClosure13
0%
0/1
N/A
1
ReFrame$AjcClosure15
0%
0/1
N/A
1
ReFrame$AjcClosure17
0%
0/1
N/A
1
ReFrame$AjcClosure19
0%
0/1
N/A
1
ReFrame$AjcClosure21
0%
0/1
N/A
1
ReFrame$AjcClosure23
0%
0/1
N/A
1
ReFrame$AjcClosure25
0%
0/1
N/A
1
ReFrame$AjcClosure27
0%
0/1
N/A
1
ReFrame$AjcClosure29
0%
0/1
N/A
1
ReFrame$AjcClosure3
0%
0/1
N/A
1
ReFrame$AjcClosure31
0%
0/1
N/A
1
ReFrame$AjcClosure33
0%
0/1
N/A
1
ReFrame$AjcClosure35
0%
0/1
N/A
1
ReFrame$AjcClosure37
0%
0/1
N/A
1
ReFrame$AjcClosure39
0%
0/1
N/A
1
ReFrame$AjcClosure41
0%
0/1
N/A
1
ReFrame$AjcClosure43
0%
0/1
N/A
1
ReFrame$AjcClosure45
0%
0/1
N/A
1
ReFrame$AjcClosure47
0%
0/1
N/A
1
ReFrame$AjcClosure49
0%
0/1
N/A
1
ReFrame$AjcClosure5
0%
0/1
N/A
1
ReFrame$AjcClosure51
0%
0/1
N/A
1
ReFrame$AjcClosure53
0%
0/1
N/A
1
ReFrame$AjcClosure55
0%
0/1
N/A
1
ReFrame$AjcClosure57
0%
0/1
N/A
1
ReFrame$AjcClosure59
0%
0/1
N/A
1
ReFrame$AjcClosure61
0%
0/1
N/A
1
ReFrame$AjcClosure63
0%
0/1
N/A
1
ReFrame$AjcClosure65
0%
0/1
N/A
1
ReFrame$AjcClosure67
0%
0/1
N/A
1
ReFrame$AjcClosure69
0%
0/1
N/A
1
ReFrame$AjcClosure7
0%
0/1
N/A
1
ReFrame$AjcClosure71
0%
0/1
N/A
1
ReFrame$AjcClosure9
0%
0/1
N/A
1
 
 1  0
 /**
 2  
  * Copyright (c) 2012-2016, jcabi.com
 3  
  * All rights reserved.
 4  
  *
 5  
  * Redistribution and use in source and binary forms, with or without
 6  
  * modification, are permitted provided that the following conditions
 7  
  * are met: 1) Redistributions of source code must retain the above
 8  
  * copyright notice, this list of conditions and the following
 9  
  * disclaimer. 2) Redistributions in binary form must reproduce the above
 10  
  * copyright notice, this list of conditions and the following
 11  
  * disclaimer in the documentation and/or other materials provided
 12  
  * with the distribution. 3) Neither the name of the jcabi.com nor
 13  
  * the names of its contributors may be used to endorse or promote
 14  
  * products derived from this software without specific prior written
 15  
  * permission.
 16  
  *
 17  
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 18  
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 19  
  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 20  
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 21  
  * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 22  
  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 23  
  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24  
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 25  
  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 26  
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 27  
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 28  
  * OF THE POSSIBILITY OF SUCH DAMAGE.
 29  
  */
 30  
 package com.jcabi.dynamo.retry;
 31  
 
 32  
 import com.amazonaws.services.dynamodbv2.model.Condition;
 33  
 import com.jcabi.aspects.Immutable;
 34  
 import com.jcabi.aspects.Loggable;
 35  
 import com.jcabi.aspects.RetryOnFailure;
 36  
 import com.jcabi.aspects.Tv;
 37  
 import com.jcabi.dynamo.Frame;
 38  
 import com.jcabi.dynamo.Item;
 39  
 import com.jcabi.dynamo.Table;
 40  
 import com.jcabi.dynamo.Valve;
 41  
 import java.util.Collection;
 42  
 import java.util.Iterator;
 43  
 import java.util.Map;
 44  
 import java.util.concurrent.TimeUnit;
 45  
 import lombok.EqualsAndHashCode;
 46  
 import lombok.ToString;
 47  
 
 48  
 /**
 49  
  * Frame that retries on failure.
 50  
  *
 51  
  * @author Yegor Bugayenko (yegor@tpc2.com)
 52  
  * @version $Id: 06740a2305d9f3cc14ea9d9db5647c74d85d4f82 $
 53  
  * @since 0.9
 54  
  */
 55  0
 @Immutable
 56  
 @Loggable(Loggable.DEBUG)
 57  0
 @ToString
 58  0
 @EqualsAndHashCode(of = "origin")
 59  
 @SuppressWarnings("PMD.TooManyMethods")
 60  
 public final class ReFrame implements Frame {
 61  
 
 62  
     /**
 63  
      * Original frame.
 64  
      */
 65  
     private final transient Frame origin;
 66  
 
 67  
     /**
 68  
      * Public ctor.
 69  
      * @param frame Origin frame
 70  
      */
 71  0
     public ReFrame(final Frame frame) {
 72  0
         this.origin = frame;
 73  0
     }
 74  
 
 75  
     @Override
 76  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 77  
     public Frame where(final String name, final String value) {
 78  0
         return new ReFrame(this.origin.where(name, value));
 79  
     }
 80  
 
 81  
     @Override
 82  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 83  
     public Frame where(final String name, final Condition condition) {
 84  0
         return new ReFrame(this.origin.where(name, condition));
 85  
     }
 86  
 
 87  
     @Override
 88  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 89  
     public Frame where(final Map<String, Condition> conditions) {
 90  0
         return new ReFrame(this.origin.where(conditions));
 91  
     }
 92  
 
 93  
     @Override
 94  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 95  
     public Table table() {
 96  0
         return new ReTable(this.origin.table());
 97  
     }
 98  
 
 99  
     @Override
 100  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 101  
     public Frame through(final Valve valve) {
 102  0
         return new ReFrame(this.origin.through(new ReValve(valve)));
 103  
     }
 104  
 
 105  
     @Override
 106  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 107  
     public int size() {
 108  0
         return this.origin.size();
 109  
     }
 110  
 
 111  
     @Override
 112  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 113  
     public boolean isEmpty() {
 114  0
         return this.origin.isEmpty();
 115  
     }
 116  
 
 117  
     @Override
 118  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 119  
     public boolean contains(final Object obj) {
 120  0
         return this.origin.contains(obj);
 121  
     }
 122  
 
 123  
     @Override
 124  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 125  
     public Iterator<Item> iterator() {
 126  0
         return new ReIterator<Item>(this.origin.iterator());
 127  
     }
 128  
 
 129  
     @Override
 130  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 131  
     public Object[] toArray() {
 132  0
         return this.origin.toArray();
 133  
     }
 134  
 
 135  
     @Override
 136  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 137  
     @SuppressWarnings("PMD.UseVarargs")
 138  
     public <T> T[] toArray(final T[] arr) {
 139  0
         return this.origin.toArray(arr);
 140  
     }
 141  
 
 142  
     @Override
 143  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 144  
     public boolean add(final Item item) {
 145  0
         return this.origin.add(item);
 146  
     }
 147  
 
 148  
     @Override
 149  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 150  
     public boolean remove(final Object obj) {
 151  0
         return this.origin.remove(obj);
 152  
     }
 153  
 
 154  
     @Override
 155  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 156  
     public boolean containsAll(final Collection<?> list) {
 157  0
         return this.origin.containsAll(list);
 158  
     }
 159  
 
 160  
     @Override
 161  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 162  
     public boolean addAll(final Collection<? extends Item> list) {
 163  0
         return this.origin.addAll(list);
 164  
     }
 165  
 
 166  
     @Override
 167  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 168  
     public boolean removeAll(final Collection<?> list) {
 169  0
         return this.origin.removeAll(list);
 170  
     }
 171  
 
 172  
     @Override
 173  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 174  
     public boolean retainAll(final Collection<?> list) {
 175  0
         return this.origin.retainAll(list);
 176  
     }
 177  
 
 178  
     @Override
 179  
     @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS)
 180  
     public void clear() {
 181  0
         this.origin.clear();
 182  0
     }
 183  
 
 184  
 }