EMMA Coverage Report (generated Fri Aug 26 14:14:05 EDT 2011)
[all classes][org.jclouds.trmk.vcloud_0_8.functions]

COVERAGE SUMMARY FOR SOURCE FILE [AllVDCsInOrg.java]

nameclass, %method, %block, %line, %
AllVDCsInOrg.java0%   (0/2)0%   (0/5)0%   (0/53)0%   (0/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AllVDCsInOrg0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/8)
AllVDCsInOrg (TerremarkVCloudAsyncClient, ExecutorService): void 0%   (0/1)0%   (0/12)0%   (0/5)
access$000 (AllVDCsInOrg): TerremarkVCloudAsyncClient 0%   (0/1)0%   (0/3)0%   (0/1)
apply (Org): Iterable 0%   (0/1)0%   (0/25)0%   (0/2)
     
class AllVDCsInOrg$10%   (0/1)0%   (0/2)0%   (0/13)0%   (0/2)
AllVDCsInOrg$1 (AllVDCsInOrg): void 0%   (0/1)0%   (0/6)0%   (0/1)
apply (ReferenceType): Future 0%   (0/1)0%   (0/7)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.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;
35import org.jclouds.trmk.vcloud_0_8.domain.ReferenceType;
36 
37import com.google.common.base.Function;
38 
39/**
40 * @author Adrian Cole
41 */
42@Singleton
43public class AllVDCsInOrg implements Function<Org, Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.VDC>> {
44   @Resource
45   public Logger logger = Logger.NULL;
46 
47   private final TerremarkVCloudAsyncClient aclient;
48   private final ExecutorService executor;
49 
50   @Inject
51   AllVDCsInOrg(TerremarkVCloudAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
52      this.aclient = aclient;
53      this.executor = executor;
54   }
55 
56   @Override
57   public Iterable<? extends org.jclouds.trmk.vcloud_0_8.domain.VDC> apply(final Org org) {
58 
59      Iterable<org.jclouds.trmk.vcloud_0_8.domain.VDC> catalogItems = transformParallel(org.getVDCs().values(),
60            new Function<ReferenceType, Future<org.jclouds.trmk.vcloud_0_8.domain.VDC>>() {
61               @SuppressWarnings("unchecked")
62               @Override
63               public Future<org.jclouds.trmk.vcloud_0_8.domain.VDC> apply(ReferenceType from) {
64                  return (Future<org.jclouds.trmk.vcloud_0_8.domain.VDC>) aclient.getVDC(from.getHref());
65               }
66 
67            }, executor, null, logger, "vdcs in org " + org.getName());
68      return catalogItems;
69   }
70 
71}

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