Class AdaptingComputeServiceStrategies<N,H,I,L>
- java.lang.Object
-
- org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies<N,H,I,L>
-
- All Implemented Interfaces:
CreateNodeWithGroupEncodedIntoName,DestroyNodeStrategy,GetImageStrategy,GetNodeMetadataStrategy,ListNodesStrategy,RebootNodeStrategy,ResumeNodeStrategy,SuspendNodeStrategy
@Singleton public class AdaptingComputeServiceStrategies<N,H,I,L> extends Object implements CreateNodeWithGroupEncodedIntoName, DestroyNodeStrategy, GetNodeMetadataStrategy, GetImageStrategy, ListNodesStrategy, RebootNodeStrategy, ResumeNodeStrategy, SuspendNodeStrategy
-
-
Constructor Summary
Constructors Constructor Description AdaptingComputeServiceStrategies(Map<String,Credentials> credentialStore, PrioritizeCredentialsFromTemplate prioritizeCredentialsFromTemplate, ComputeServiceAdapter<N,H,I,L> client, com.google.common.base.Function<N,NodeMetadata> nodeMetadataAdapter, com.google.common.base.Function<I,Image> imageAdapter, ComputeServiceAdapterContextModule.AddDefaultCredentialsToImage addDefaultCredentialsToImage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeMetadatacreateNodeWithGroupEncodedIntoName(String group, String name, Template template)create a node given the name and template parameters such as imageid, hardwareid, and locationid.NodeMetadatadestroyNode(String id)ImagegetImage(String id)NodeMetadatagetNode(String id)Iterable<? extends NodeMetadata>listDetailsOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)Iterable<? extends ComputeMetadata>listNodes()Iterable<? extends NodeMetadata>listNodesByIds(Iterable<String> ids)NodeMetadatarebootNode(String id)NodeMetadataresumeNode(String id)NodeMetadatasuspendNode(String id)
-
-
-
Field Detail
-
logger
@Named("jclouds.compute") protected Logger logger
-
-
Constructor Detail
-
AdaptingComputeServiceStrategies
@Inject public AdaptingComputeServiceStrategies(Map<String,Credentials> credentialStore, PrioritizeCredentialsFromTemplate prioritizeCredentialsFromTemplate, ComputeServiceAdapter<N,H,I,L> client, com.google.common.base.Function<N,NodeMetadata> nodeMetadataAdapter, com.google.common.base.Function<I,Image> imageAdapter, ComputeServiceAdapterContextModule.AddDefaultCredentialsToImage addDefaultCredentialsToImage)
-
-
Method Detail
-
listNodes
public Iterable<? extends ComputeMetadata> listNodes()
- Specified by:
listNodesin interfaceListNodesStrategy
-
listNodesByIds
public Iterable<? extends NodeMetadata> listNodesByIds(Iterable<String> ids)
- Specified by:
listNodesByIdsin interfaceListNodesStrategy
-
listDetailsOnNodesMatching
public Iterable<? extends NodeMetadata> listDetailsOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
- Specified by:
listDetailsOnNodesMatchingin interfaceListNodesStrategy
-
getImage
public Image getImage(String id)
- Specified by:
getImagein interfaceGetImageStrategy
-
getNode
public NodeMetadata getNode(String id)
- Specified by:
getNodein interfaceGetNodeMetadataStrategy
-
rebootNode
public NodeMetadata rebootNode(String id)
- Specified by:
rebootNodein interfaceRebootNodeStrategy
-
resumeNode
public NodeMetadata resumeNode(String id)
- Specified by:
resumeNodein interfaceResumeNodeStrategy
-
suspendNode
public NodeMetadata suspendNode(String id)
- Specified by:
suspendNodein interfaceSuspendNodeStrategy
-
destroyNode
public NodeMetadata destroyNode(String id)
- Specified by:
destroyNodein interfaceDestroyNodeStrategy- Returns:
- null if the node wasn't found
-
createNodeWithGroupEncodedIntoName
public NodeMetadata createNodeWithGroupEncodedIntoName(String group, String name, Template template)
create a node given the name and template parameters such as imageid, hardwareid, and locationid.- Specified by:
createNodeWithGroupEncodedIntoNamein interfaceCreateNodeWithGroupEncodedIntoName- Parameters:
group- group name supplied by the username- supplied byCreateNodesInGroupThenAddToSetand must have the tag encoded into it.template- supplied by the user- Returns:
- NodeMetadata from the new object, most likely in some pending state.
-
-