Class JcloudsComputeProducer

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.EndpointAware, 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.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 rebootNode​(org.apache.camel.Exchange exchange)
      Reboot the node with the specified nodeId.
      protected void resumeNode​(org.apache.camel.Exchange exchange)
      Suspend the node with the specified nodeId.
      protected void runScriptOnNode​(org.apache.camel.Exchange exchange)
      Runs a script on the target node.
      protected void suspendNode​(org.apache.camel.Exchange exchange)
      Suspend the node with the specified nodeId.
      • Methods inherited from class org.apache.camel.support.DefaultProducer

        createExchange, doStart, doStop, isSingleton, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • 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.EndpointAware
        Overrides:
        getEndpoint in class org.apache.camel.support.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.
      • rebootNode

        protected void rebootNode​(org.apache.camel.Exchange exchange)
        Reboot the node with the specified nodeId.
      • suspendNode

        protected void suspendNode​(org.apache.camel.Exchange exchange)
        Suspend the node with the specified nodeId.
      • resumeNode

        protected void resumeNode​(org.apache.camel.Exchange exchange)
        Suspend the node with the specified nodeId.
      • 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.