org.apache.whirr.service
Class Service

java.lang.Object
  extended by org.apache.whirr.service.Service
Direct Known Subclasses:
CassandraService, HadoopService, ZooKeeperService

public abstract class Service
extends Object

This class represents a service that a client wants to use. This class is used to start and stop clusters that provide the service.


Constructor Summary
Service()
           
 
Method Summary
 void destroyCluster(ClusterSpec clusterSpec)
          Stop the cluster and destroy all resources associated with it.
abstract  String getName()
           
 Set<? extends org.jclouds.compute.domain.NodeMetadata> getNodes(ClusterSpec clusterSpec)
           
abstract  Cluster launchCluster(ClusterSpec clusterSpec)
          Start the cluster described by clusterSpec and block until the cluster is available.
static com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> runningWithTag(String tag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service()
Method Detail

getName

public abstract String getName()
Returns:
the unique name of the service.

launchCluster

public abstract Cluster launchCluster(ClusterSpec clusterSpec)
                               throws IOException
Start the cluster described by clusterSpec and block until the cluster is available. It is not guaranteed that the service running on the cluster has started when this method returns.

Parameters:
clusterSpec -
Returns:
an object representing the running cluster
Throws:
IOException - if there is a problem while starting the cluster. The cluster may or may not have started.

destroyCluster

public void destroyCluster(ClusterSpec clusterSpec)
                    throws IOException
Stop the cluster and destroy all resources associated with it.

Throws:
IOException - if there is a problem while stopping the cluster. The cluster may or may not have been stopped.

getNodes

public Set<? extends org.jclouds.compute.domain.NodeMetadata> getNodes(ClusterSpec clusterSpec)
                                                                throws IOException
Throws:
IOException

runningWithTag

public static com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> runningWithTag(String tag)


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.