org.jclouds.joyent.cloudapi.v6_5.compute.functions
Class MachineInDatacenterToNodeMetadata

java.lang.Object
  extended by org.jclouds.joyent.cloudapi.v6_5.compute.functions.MachineInDatacenterToNodeMetadata
All Implemented Interfaces:
com.google.common.base.Function<MachineInDatacenter,NodeMetadata>

public class MachineInDatacenterToNodeMetadata
extends Object
implements com.google.common.base.Function<MachineInDatacenter,NodeMetadata>

A function for transforming a cloudApi-specific Machine into a generic NodeMetadata object.

Author:
Adrian Cole

Field Summary
protected  com.google.common.base.Supplier<Set<? extends Hardware>> hardwares
           
protected  com.google.common.base.Supplier<Set<? extends Image>> images
           
protected  com.google.common.base.Supplier<Map<String,Location>> locationIndex
           
protected  Logger logger
           
protected  GroupNamingConvention nodeNamingConvention
           
protected  Map<Machine.State,NodeMetadata.Status> toPortableNodeStatus
           
 
Constructor Summary
MachineInDatacenterToNodeMetadata(Map<Machine.State,NodeMetadata.Status> toPortableNodeStatus, com.google.common.base.Supplier<Map<String,Location>> locationIndex, com.google.common.base.Supplier<Set<? extends Image>> images, com.google.common.base.Supplier<Set<? extends Hardware>> hardwares, GroupNamingConvention.Factory namingConvention)
           
 
Method Summary
 NodeMetadata apply(MachineInDatacenter machineInDatacenter)
           
protected  Hardware findHardwareForMachineOrNull(MachineInDatacenter machineInDatacenter)
           
<T extends ComputeMetadata>
T
findObjectOfTypeForMachineOrNull(Set<? extends T> supply, String type, String objectId, DatacenterAndId machineInDatacenter)
           
protected  OperatingSystem findOperatingSystemForMachineOrNull(MachineInDatacenter machineInDatacenter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Field Detail

logger

@Named(value="jclouds.compute")
protected Logger logger

toPortableNodeStatus

protected Map<Machine.State,NodeMetadata.Status> toPortableNodeStatus

locationIndex

protected final com.google.common.base.Supplier<Map<String,Location>> locationIndex

images

protected final com.google.common.base.Supplier<Set<? extends Image>> images

hardwares

protected final com.google.common.base.Supplier<Set<? extends Hardware>> hardwares

nodeNamingConvention

protected final GroupNamingConvention nodeNamingConvention
Constructor Detail

MachineInDatacenterToNodeMetadata

@Inject
public MachineInDatacenterToNodeMetadata(Map<Machine.State,NodeMetadata.Status> toPortableNodeStatus,
                                                com.google.common.base.Supplier<Map<String,Location>> locationIndex,
                                                com.google.common.base.Supplier<Set<? extends Image>> images,
                                                com.google.common.base.Supplier<Set<? extends Hardware>> hardwares,
                                                GroupNamingConvention.Factory namingConvention)
Method Detail

apply

public NodeMetadata apply(MachineInDatacenter machineInDatacenter)
Specified by:
apply in interface com.google.common.base.Function<MachineInDatacenter,NodeMetadata>

findHardwareForMachineOrNull

protected Hardware findHardwareForMachineOrNull(MachineInDatacenter machineInDatacenter)

findOperatingSystemForMachineOrNull

protected OperatingSystem findOperatingSystemForMachineOrNull(MachineInDatacenter machineInDatacenter)

findObjectOfTypeForMachineOrNull

public <T extends ComputeMetadata> T findObjectOfTypeForMachineOrNull(Set<? extends T> supply,
                                                                      String type,
                                                                      String objectId,
                                                                      DatacenterAndId machineInDatacenter)


Copyright © 2009-2012 jclouds. All Rights Reserved.