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

COVERAGE SUMMARY FOR SOURCE FILE [OrgsForNames.java]

nameclass, %method, %block, %line, %
OrgsForNames.java0%   (0/2)0%   (0/5)0%   (0/40)0%   (0/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OrgsForNames0%   (0/1)0%   (0/3)0%   (0/28)0%   (0/7)
OrgsForNames (CommonVCloudAsyncClient, ExecutorService): void 0%   (0/1)0%   (0/12)0%   (0/5)
access$000 (OrgsForNames): CommonVCloudAsyncClient 0%   (0/1)0%   (0/3)0%   (0/1)
apply (Iterable): Iterable 0%   (0/1)0%   (0/13)0%   (0/1)
     
class OrgsForNames$10%   (0/1)0%   (0/2)0%   (0/12)0%   (0/2)
OrgsForNames$1 (OrgsForNames): void 0%   (0/1)0%   (0/6)0%   (0/1)
apply (String): Future 0%   (0/1)0%   (0/6)0%   (0/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.vcloud.functions;
20 
21import static org.jclouds.concurrent.FutureIterables.transformParallel;
22 
23import java.util.concurrent.ExecutorService;
24import java.util.concurrent.Future;
25 
26import javax.annotation.Resource;
27import javax.inject.Inject;
28import javax.inject.Named;
29import javax.inject.Singleton;
30 
31import org.jclouds.Constants;
32import org.jclouds.logging.Logger;
33import org.jclouds.vcloud.CommonVCloudAsyncClient;
34import org.jclouds.vcloud.domain.Org;
35 
36import com.google.common.base.Function;
37 
38/**
39 * @author Adrian Cole
40 */
41@Singleton
42public class OrgsForNames implements Function<Iterable<String>, Iterable<? extends Org>> {
43   @Resource
44   public Logger logger = Logger.NULL;
45   private final CommonVCloudAsyncClient aclient;
46   private final ExecutorService executor;
47 
48   @Inject
49   OrgsForNames(CommonVCloudAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
50      this.aclient = aclient;
51      this.executor = executor;
52   }
53 
54   @Override
55   public Iterable<? extends Org> apply(Iterable<String> from) {
56      return transformParallel(from, new Function<String, Future<Org>>() {
57 
58         @SuppressWarnings("unchecked")
59         @Override
60         public Future<Org> apply(String from) {
61            return (Future<Org>) aclient.findOrgNamed(from);
62         }
63 
64      }, executor, null, logger, "organizations for names");
65   }
66 
67}

[all classes][org.jclouds.vcloud.functions]
EMMA 2.0.5312 (C) Vladimir Roubtsov