EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.trmk.vcloud_0_8.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 (TerremarkVCloudAsyncClient, ExecutorService): void 0%   (0/1)0%   (0/12)0%   (0/5)
access$000 (OrgsForNames): TerremarkVCloudAsyncClient 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 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.trmk.vcloud_0_8.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.trmk.vcloud_0_8.TerremarkVCloudAsyncClient;
34import org.jclouds.trmk.vcloud_0_8.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 TerremarkVCloudAsyncClient aclient;
46   private final ExecutorService executor;
47 
48   @Inject
49   OrgsForNames(TerremarkVCloudAsyncClient 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.trmk.vcloud_0_8.functions]
EMMA 2.0.5312 (C) Vladimir Roubtsov