EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.blobstore.strategy.internal]

COVERAGE SUMMARY FOR SOURCE FILE [CountBlobTypeInList.java]

nameclass, %method, %block, %line, %
CountBlobTypeInList.java100% (1/1)67%  (2/3)74%  (14/19)80%  (4/5)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CountBlobTypeInList100% (1/1)67%  (2/3)74%  (14/19)80%  (4/5)
execute (String): long 0%   (0/1)0%   (0/5)0%   (0/1)
CountBlobTypeInList (ListBlobsInContainer): void 100% (1/1)100% (6/6)100% (3/3)
execute (String, ListContainerOptions): long 100% (1/1)100% (8/8)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.blobstore.strategy.internal;
20 
21import javax.inject.Inject;
22import javax.inject.Singleton;
23 
24import org.jclouds.blobstore.options.ListContainerOptions;
25import org.jclouds.blobstore.strategy.CountListStrategy;
26import org.jclouds.blobstore.strategy.ListBlobsInContainer;
27 
28import com.google.common.collect.Iterables;
29 
30/**
31 * counts all blobs in the blobstore at the prefix by the most efficient means possible.
32 * 
33 * @author Adrian Cole
34 */
35@Singleton
36public class CountBlobTypeInList implements CountListStrategy {
37   protected final ListBlobsInContainer getAllBlobMetadata;
38 
39   @Inject
40   CountBlobTypeInList(ListBlobsInContainer getAllBlobMetadata) {
41      this.getAllBlobMetadata = getAllBlobMetadata;
42   }
43 
44   public long execute(String container, ListContainerOptions options) {
45      return Iterables.size(getAllBlobMetadata.execute(container, options));
46   }
47 
48   public long execute(String container) {
49      return execute(container, null);
50   }
51}

[all classes][org.jclouds.blobstore.strategy.internal]
EMMA 2.0.5312 (C) Vladimir Roubtsov