Class ServerInRegionToNodeMetadata
- java.lang.Object
-
- org.jclouds.openstack.nova.v2_0.compute.functions.ServerInRegionToNodeMetadata
-
- All Implemented Interfaces:
com.google.common.base.Function<ServerInRegion,NodeMetadata>
,Function<ServerInRegion,NodeMetadata>
public class ServerInRegionToNodeMetadata extends Object implements com.google.common.base.Function<ServerInRegion,NodeMetadata>
A function for transforming a nova-specific Server into a generic NodeMetadata object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServerInRegionToNodeMetadata.AddressToStringTransformationFunction
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.base.Supplier<Set<? extends Hardware>>
hardwares
protected com.google.common.base.Supplier<Set<? extends Image>>
images
static com.google.common.base.Predicate<Address>
isFloatingAddress
static com.google.common.base.Predicate<String>
isInet4Address
static com.google.common.base.Predicate<Address>
isPrivateAddress
protected com.google.common.base.Supplier<Map<String,Location>>
locationIndex
protected Logger
logger
protected GroupNamingConvention
nodeNamingConvention
protected Map<Server.Status,NodeMetadata.Status>
toPortableNodeStatus
-
Constructor Summary
Constructors Constructor Description ServerInRegionToNodeMetadata(Map<Server.Status,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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeMetadata
apply(ServerInRegion serverInRegion)
protected Hardware
findHardwareForServerOrNull(ServerInRegion serverInRegion)
<T extends ComputeMetadata>
TfindObjectOfTypeForServerOrNull(Set<? extends T> supply, String type, String objectId, RegionAndId serverInRegion)
protected OperatingSystem
findOperatingSystemForServerOrNull(ServerInRegion serverInRegion)
-
-
-
Field Detail
-
logger
@Named("jclouds.compute") protected Logger logger
-
toPortableNodeStatus
protected Map<Server.Status,NodeMetadata.Status> toPortableNodeStatus
-
nodeNamingConvention
protected final GroupNamingConvention nodeNamingConvention
-
isFloatingAddress
public static final com.google.common.base.Predicate<Address> isFloatingAddress
-
isPrivateAddress
public static final com.google.common.base.Predicate<Address> isPrivateAddress
-
isInet4Address
public static final com.google.common.base.Predicate<String> isInet4Address
-
-
Constructor Detail
-
ServerInRegionToNodeMetadata
@Inject public ServerInRegionToNodeMetadata(Map<Server.Status,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(ServerInRegion serverInRegion)
- Specified by:
apply
in interfacecom.google.common.base.Function<ServerInRegion,NodeMetadata>
- Specified by:
apply
in interfaceFunction<ServerInRegion,NodeMetadata>
-
findHardwareForServerOrNull
protected Hardware findHardwareForServerOrNull(ServerInRegion serverInRegion)
-
findOperatingSystemForServerOrNull
protected OperatingSystem findOperatingSystemForServerOrNull(ServerInRegion serverInRegion)
-
findObjectOfTypeForServerOrNull
public <T extends ComputeMetadata> T findObjectOfTypeForServerOrNull(Set<? extends T> supply, String type, String objectId, RegionAndId serverInRegion)
-
-