org.apache.camel.component.jclouds
Class JcloudsComputeProducer

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultProducer
          extended by org.apache.camel.component.jclouds.JcloudsProducer
              extended by org.apache.camel.component.jclouds.JcloudsComputeProducer
All Implemented Interfaces:
org.apache.camel.IsSingleton, org.apache.camel.Processor, org.apache.camel.Producer, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class JcloudsComputeProducer
extends JcloudsProducer


Field Summary
 
Fields inherited from class org.apache.camel.impl.DefaultProducer
log
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
JcloudsComputeProducer(JcloudsEndpoint endpoint, org.jclouds.compute.ComputeService computeService)
           
 
Method Summary
protected  void createNode(org.apache.camel.Exchange exchange)
          Create a node with the specified group.
protected  void destroyNode(org.apache.camel.Exchange exchange)
          Destroys the node with the specified nodeId.
 com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> getComputePredicate(org.apache.camel.Exchange exchange)
          Returns the required Predicate for the Exhcnage.
 JcloudsComputeEndpoint getEndpoint()
           
protected  String getGroup(org.apache.camel.Exchange exchange)
          Retrieves the group from the URI or from the exchange headers.
protected  String getHardwareId(org.apache.camel.Exchange exchange)
          Retrieves the hardware id from the URI or from the exchange headers.
protected  String getImageId(org.apache.camel.Exchange exchange)
          Retrieves the image id from the URI or from the exchange properties.
protected  String getLocationId(org.apache.camel.Exchange exchange)
          Retrieves the location id from the URI or from the exchange headers.
protected  String getNodeId(org.apache.camel.Exchange exchange)
          Retrieves the node id from the URI or from the exchange headers.
 com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> getNodePredicate(org.apache.camel.Exchange exchange)
          Returns the required Predicate for the Exhcnage.
 org.jclouds.compute.domain.NodeMetadata.Status getNodeState(org.apache.camel.Exchange exchange)
          Retrieves the node state from the URI or from the exchange headers.
 String getOperation(org.apache.camel.Exchange exchange)
          Retrieves the operation from the URI or from the exchange headers.
protected  String getUser(org.apache.camel.Exchange exchange)
          Retrieves the user from the URI or from the exchange headers.
protected  void listHardware(org.apache.camel.Exchange exchange)
          Sets the available hardware profiles to the out message.
protected  void listImages(org.apache.camel.Exchange exchange)
          Sets the available images to the out message.
protected  void listNodes(org.apache.camel.Exchange exchange)
          Sets the metadata of the available nodes to the out message.
 void process(org.apache.camel.Exchange exchange)
           
protected  void runScriptOnNode(org.apache.camel.Exchange exchange)
          Runs a script on the target node.
 
Methods inherited from class org.apache.camel.impl.DefaultProducer
createExchange, createExchange, createExchange, doStart, doStop, isSingleton, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

JcloudsComputeProducer

public JcloudsComputeProducer(JcloudsEndpoint endpoint,
                              org.jclouds.compute.ComputeService computeService)
Method Detail

getEndpoint

public JcloudsComputeEndpoint getEndpoint()
Specified by:
getEndpoint in interface org.apache.camel.Producer
Overrides:
getEndpoint in class org.apache.camel.impl.DefaultProducer

process

public void process(org.apache.camel.Exchange exchange)
             throws Exception
Throws:
Exception

createNode

protected void createNode(org.apache.camel.Exchange exchange)
                   throws org.apache.camel.CamelException
Create a node with the specified group.

Throws:
org.apache.camel.CamelException

runScriptOnNode

protected void runScriptOnNode(org.apache.camel.Exchange exchange)
                        throws org.apache.camel.CamelException
Runs a script on the target node.

Throws:
org.apache.camel.CamelException

destroyNode

protected void destroyNode(org.apache.camel.Exchange exchange)
Destroys the node with the specified nodeId.


listNodes

protected void listNodes(org.apache.camel.Exchange exchange)
Sets the metadata of the available nodes to the out message.


listImages

protected void listImages(org.apache.camel.Exchange exchange)
Sets the available images to the out message.


listHardware

protected void listHardware(org.apache.camel.Exchange exchange)
Sets the available hardware profiles to the out message.


getComputePredicate

public com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> getComputePredicate(org.apache.camel.Exchange exchange)
Returns the required Predicate for the Exhcnage. The predicate can be used for filtering.


getNodePredicate

public com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> getNodePredicate(org.apache.camel.Exchange exchange)
Returns the required Predicate for the Exhcnage. The predicate can be used for filtering.


getOperation

public String getOperation(org.apache.camel.Exchange exchange)
Retrieves the operation from the URI or from the exchange headers. The header will take precedence over the URI.


getNodeState

public org.jclouds.compute.domain.NodeMetadata.Status getNodeState(org.apache.camel.Exchange exchange)
Retrieves the node state from the URI or from the exchange headers. The header will take precedence over the URI.


getImageId

protected String getImageId(org.apache.camel.Exchange exchange)
Retrieves the image id from the URI or from the exchange properties. The property will take precedence over the URI.


getHardwareId

protected String getHardwareId(org.apache.camel.Exchange exchange)
Retrieves the hardware id from the URI or from the exchange headers. The header will take precedence over the URI.


getLocationId

protected String getLocationId(org.apache.camel.Exchange exchange)
Retrieves the location id from the URI or from the exchange headers. The header will take precedence over the URI.


getNodeId

protected String getNodeId(org.apache.camel.Exchange exchange)
Retrieves the node id from the URI or from the exchange headers. The header will take precedence over the URI.


getGroup

protected String getGroup(org.apache.camel.Exchange exchange)
Retrieves the group from the URI or from the exchange headers. The header will take precedence over the URI.


getUser

protected String getUser(org.apache.camel.Exchange exchange)
Retrieves the user from the URI or from the exchange headers. The header will take precedence over the URI.



Apache Camel