org.jclouds.compute.strategy.impl
Class AdaptingComputeServiceStrategies<N,H,I,L>

java.lang.Object
  extended by org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies<N,H,I,L>
All Implemented Interfaces:
CreateNodeWithGroupEncodedIntoName, DestroyNodeStrategy, GetNodeMetadataStrategy, ListNodesStrategy, RebootNodeStrategy, ResumeNodeStrategy, SuspendNodeStrategy

@Singleton
public class AdaptingComputeServiceStrategies<N,H,I,L>
extends Object
implements CreateNodeWithGroupEncodedIntoName, DestroyNodeStrategy, GetNodeMetadataStrategy, ListNodesStrategy, RebootNodeStrategy, ResumeNodeStrategy, SuspendNodeStrategy

Author:
Adrian Cole

Field Summary
protected  Logger logger
           
 
Constructor Summary
AdaptingComputeServiceStrategies(Map<String,Credentials> credentialStore, PrioritizeCredentialsFromTemplate prioritizeCredentialsFromTemplate, ComputeServiceAdapter<N,H,I,L> client, com.google.common.base.Function<N,NodeMetadata> nodeMetadataAdapter)
           
 
Method Summary
 NodeMetadata createNodeWithGroupEncodedIntoName(String group, String name, Template template)
          create a node given the name and template parameters such as imageid, hardwareid, and locationid.
 NodeMetadata destroyNode(String id)
           
 NodeMetadata getNode(String id)
           
 Iterable<? extends NodeMetadata> listDetailsOnNodesMatching(com.google.common.base.Predicate<ComputeMetadata> filter)
           
 Iterable<? extends ComputeMetadata> listNodes()
           
 NodeMetadata rebootNode(String id)
           
 NodeMetadata resumeNode(String id)
           
 NodeMetadata suspendNode(String id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

@Named(value="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)
Method Detail

listNodes

public Iterable<? extends ComputeMetadata> listNodes()
Specified by:
listNodes in interface ListNodesStrategy

listDetailsOnNodesMatching

public Iterable<? extends NodeMetadata> listDetailsOnNodesMatching(com.google.common.base.Predicate<ComputeMetadata> filter)
Specified by:
listDetailsOnNodesMatching in interface ListNodesStrategy

getNode

public NodeMetadata getNode(String id)
Specified by:
getNode in interface GetNodeMetadataStrategy

rebootNode

public NodeMetadata rebootNode(String id)
Specified by:
rebootNode in interface RebootNodeStrategy

resumeNode

public NodeMetadata resumeNode(String id)
Specified by:
resumeNode in interface ResumeNodeStrategy

suspendNode

public NodeMetadata suspendNode(String id)
Specified by:
suspendNode in interface SuspendNodeStrategy

destroyNode

public NodeMetadata destroyNode(String id)
Specified by:
destroyNode in interface DestroyNodeStrategy
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:
createNodeWithGroupEncodedIntoName in interface CreateNodeWithGroupEncodedIntoName
Parameters:
group - group name supplied by the user
name - supplied by CreateNodesInGroupThenAddToSet and must have the tag encoded into it.
template - supplied by the user
Returns:
NodeMetadata from the new object, most likely in some pending state.


Copyright © 2009-2012 jclouds. All Rights Reserved.