org.apache.whirr.karaf.command.support
Class WhirrCommandSupport

java.lang.Object
  extended by org.apache.karaf.shell.console.AbstractAction
      extended by org.apache.karaf.shell.console.OsgiCommandSupport
          extended by org.apache.whirr.karaf.command.support.WhirrCommandSupport
All Implemented Interfaces:
org.apache.felix.gogo.commands.Action, org.apache.karaf.shell.console.BundleContextAware
Direct Known Subclasses:
DestroyCluster, DestroyInstance, LaunchCluster, ListCluster, RunScript

public abstract class WhirrCommandSupport
extends org.apache.karaf.shell.console.OsgiCommandSupport


Field Summary
protected  ClusterControllerFactory clusterControllerFactory
           
protected  String clusterName
           
protected  List<org.jclouds.compute.ComputeService> computeServices
           
protected  org.osgi.service.cm.ConfigurationAdmin configurationAdmin
           
protected  String endpoint
           
protected  String fileName
           
protected  String hardwareId
           
protected  String imageId
           
protected  String locationId
           
protected  String name
           
protected  String pid
           
protected  String privateKey
           
protected  String provider
           
protected  String templates
           
 
Fields inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
bundleContext, usedReferences
 
Fields inherited from class org.apache.karaf.shell.console.AbstractAction
log, session
 
Constructor Summary
WhirrCommandSupport()
           
 
Method Summary
 ClusterControllerFactory getClusterControllerFactory()
           
protected  ClusterSpec getClusterSpec()
          Returns the ClusterSpec
 org.jclouds.compute.ComputeService getComputeServiceByName(String name)
          Returns the first ComputeService that matches the name.
 org.jclouds.compute.ComputeService getComputeServiceByProvider(String provider)
          Returns the first ComputeService that matches the provider.
protected  org.apache.commons.configuration.PropertiesConfiguration getConfiguration(String pid, String fileName)
          Retrieves the configuration from a pid or a file.
 org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
           
protected  List<InstanceTemplate> getTemplate(String templates, String imageId, String hardwareId)
           
protected  InstanceTemplate.Builder getTemplateBuilder(String imageId, String hardwareId)
           
 void setClusterControllerFactory(ClusterControllerFactory clusterControllerFactory)
           
 void setComputeServices(List<org.jclouds.compute.ComputeService> computeServices)
           
 void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
           
 void validateInput()
           
 
Methods inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
execute, getAllServices, getBundleContext, getService, setBundleContext, ungetServices
 
Methods inherited from class org.apache.karaf.shell.console.AbstractAction
doExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

protected String fileName

pid

protected String pid

name

protected String name

provider

protected String provider

endpoint

protected String endpoint

templates

protected String templates

imageId

protected String imageId

locationId

protected String locationId

hardwareId

protected String hardwareId

privateKey

protected String privateKey

clusterName

protected String clusterName

clusterControllerFactory

protected ClusterControllerFactory clusterControllerFactory

configurationAdmin

protected org.osgi.service.cm.ConfigurationAdmin configurationAdmin

computeServices

protected List<org.jclouds.compute.ComputeService> computeServices
Constructor Detail

WhirrCommandSupport

public WhirrCommandSupport()
Method Detail

validateInput

public void validateInput()
                   throws Exception
Throws:
Exception

getComputeServiceByName

public org.jclouds.compute.ComputeService getComputeServiceByName(String name)
Returns the first ComputeService that matches the name.

Parameters:
name -
Returns:

getComputeServiceByProvider

public org.jclouds.compute.ComputeService getComputeServiceByProvider(String provider)
Returns the first ComputeService that matches the provider.

Parameters:
provider -
Returns:

getClusterSpec

protected ClusterSpec getClusterSpec()
                              throws Exception
Returns the ClusterSpec

Returns:
Throws:
Exception

getTemplateBuilder

protected InstanceTemplate.Builder getTemplateBuilder(String imageId,
                                                      String hardwareId)

getTemplate

protected List<InstanceTemplate> getTemplate(String templates,
                                             String imageId,
                                             String hardwareId)

getConfiguration

protected org.apache.commons.configuration.PropertiesConfiguration getConfiguration(String pid,
                                                                                    String fileName)
Retrieves the configuration from a pid or a file.

Parameters:
pid -
fileName -
Returns:

getClusterControllerFactory

public ClusterControllerFactory getClusterControllerFactory()

setClusterControllerFactory

public void setClusterControllerFactory(ClusterControllerFactory clusterControllerFactory)

getConfigurationAdmin

public org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()

setConfigurationAdmin

public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)

setComputeServices

public void setComputeServices(List<org.jclouds.compute.ComputeService> computeServices)


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