de.jw.cloud42.webapp
Class BaseFunctionsManager

java.lang.Object
  extended by de.jw.cloud42.webapp.BaseFunctionsManager

@Name(value="baseFunctionsManager")
@Scope(value=SESSION)
@Synchronized(timeout=1000000000L)
public class BaseFunctionsManager
extends java.lang.Object

Seam component wrapper around Cloud42BaseFunctions.

Author:
fbitzer

Field Summary
static java.lang.String MSG_KEYPAIR_ERROR
           
 
Constructor Summary
BaseFunctionsManager()
           
 
Method Summary
 void addPermission()
          Add a permission that was configured using a permissionConfiguration.
 void createGroup(java.lang.String name, java.lang.String description)
          Create a new security group
 void createKeypair(java.lang.String name)
          Create a keypair and outject private key in component "privateKey".
 void createNewConfiguration(java.lang.String imageId, java.lang.String imageLocation)
          Helper function, resets current instanceConfiguration and initializes values.
 void createNewPermission()
          Initializes a new permission.
 void deleteGroup(java.lang.String name)
          Delete a security group
 void deleteKeypair(com.xerox.amazonws.ec2.KeyPairInfo kp)
           
 void deregisterImage(com.xerox.amazonws.ec2.ImageDescription image)
          Deregisters an image.
 java.util.List<javax.faces.model.SelectItem> getAvailabilityZoneItems()
          Return availability zones as list of SelectItems for displaying in a dropdown box.
 java.lang.String getConsoleOutput(java.lang.String instanceId)
          Read console output for an instance and assign it to outjected variable.
 java.util.List<javax.faces.model.SelectItem> getGroupItems()
          Return groups as list of SelectItems for displaying in a dropdown box.
 java.util.List<com.xerox.amazonws.ec2.GroupDescription> getGroups()
          List all groups.
 java.util.List<com.xerox.amazonws.ec2.ImageDescription> getImages()
          List all AMIs.
 java.util.List<Instance> getInstances()
          List all active instances.
 java.util.List<javax.faces.model.SelectItem> getInstanceTypeItems()
          Return possible instanceTypes as SelectItems.
 java.util.List<javax.faces.model.SelectItem> getKeypairItems()
          Return keypairs as list of SelectItems for displaying in a dropdown box.
 java.util.List<com.xerox.amazonws.ec2.KeyPairInfo> getKeypairs()
          List all keypairs.
 java.lang.String getName(Instance instance)
          Get the user defined name for an instance.
 java.util.List<javax.faces.model.SelectItem> getRegionItems()
          Return keypairs as list of SelectItems for displaying in a dropdown box.
 java.util.List<com.xerox.amazonws.ec2.RegionInfo> getRegions()
          List all Regions.
 java.util.TimeZone getTimeZone()
          Helper functions, gets the current timezone to display dates correctly.
 void rebootInstance(java.lang.String instanceId)
          Reboot an instance.
 void registerImage(java.lang.String location)
          Register a new AMI at given location.
 void removePermission()
          Remove a permission.
 void resetGroupList()
          Reset groupList and force reload next time it is accessed.
 void resetImageList()
          Reset imageList and force reload next time it is accessed.
 void resetInstanceList()
          Reset instanceList and force reload next time it is accessed.
 void resetKeypairList()
          Reset keypairList and force reload next time it is accessed.
 void resetPrivateKey()
          Reset the private key.
 void resetRegionList()
          Reset regionList and force reload next time it is accessed.
 void runAnotherInstance(java.lang.String instanceId)
          Configures a new instance with the same configuration as the given instance.
 void runInstance()
          Starts an instance.
 void setName(java.lang.String reservationId, java.lang.String name)
          Set the user defined name for an instance.
 void stopAllInstances()
          Stop all running instances.
 void stopInstance(java.lang.String instanceId)
          Stop an instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_KEYPAIR_ERROR

public static final java.lang.String MSG_KEYPAIR_ERROR
See Also:
Constant Field Values
Constructor Detail

BaseFunctionsManager

public BaseFunctionsManager()
Method Detail

resetImageList

public void resetImageList()
Reset imageList and force reload next time it is accessed.


resetInstanceList

public void resetInstanceList()
Reset instanceList and force reload next time it is accessed.


resetGroupList

public void resetGroupList()
Reset groupList and force reload next time it is accessed.


resetKeypairList

public void resetKeypairList()
Reset keypairList and force reload next time it is accessed.


resetRegionList

public void resetRegionList()
Reset regionList and force reload next time it is accessed.


getImages

public java.util.List<com.xerox.amazonws.ec2.ImageDescription> getImages()
List all AMIs.

Returns:
null if no AMIs were found (because of missing or wrong credentials)

getInstances

public java.util.List<Instance> getInstances()
List all active instances.

Returns:
null if no instances were found

getKeypairs

public java.util.List<com.xerox.amazonws.ec2.KeyPairInfo> getKeypairs()
List all keypairs.

Returns:
null if no keypairs were found.

getRegions

public java.util.List<com.xerox.amazonws.ec2.RegionInfo> getRegions()
List all Regions.

Returns:
null if no regions were found.

getGroups

public java.util.List<com.xerox.amazonws.ec2.GroupDescription> getGroups()
List all groups.

Returns:
null if no groups were found.

getKeypairItems

public java.util.List<javax.faces.model.SelectItem> getKeypairItems()
Return keypairs as list of SelectItems for displaying in a dropdown box.

Returns:

getGroupItems

public java.util.List<javax.faces.model.SelectItem> getGroupItems()
Return groups as list of SelectItems for displaying in a dropdown box.

Returns:

getInstanceTypeItems

public java.util.List<javax.faces.model.SelectItem> getInstanceTypeItems()
Return possible instanceTypes as SelectItems.

Returns:

getRegionItems

public java.util.List<javax.faces.model.SelectItem> getRegionItems()
Return keypairs as list of SelectItems for displaying in a dropdown box.

Returns:

createNewConfiguration

public void createNewConfiguration(java.lang.String imageId,
                                   java.lang.String imageLocation)
Helper function, resets current instanceConfiguration and initializes values.

Parameters:
imageId -
imageLocation -

runInstance

public void runInstance()
Starts an instance. Uses injected instanceConfiguration to set properties.


runAnotherInstance

public void runAnotherInstance(java.lang.String instanceId)
Configures a new instance with the same configuration as the given instance. Does not start the instance.

Parameters:
instanceId - InstanceId of the instance from which the configuration should be taken.

getName

public java.lang.String getName(Instance instance)
Get the user defined name for an instance.

Parameters:
instance -
Returns:

setName

public void setName(java.lang.String reservationId,
                    java.lang.String name)
Set the user defined name for an instance.

Parameters:
instance -
name -

registerImage

public void registerImage(java.lang.String location)
Register a new AMI at given location.

Parameters:
location -

deregisterImage

public void deregisterImage(com.xerox.amazonws.ec2.ImageDescription image)
Deregisters an image.

Parameters:
image -

stopInstance

public void stopInstance(java.lang.String instanceId)
Stop an instance.

Parameters:
instanceId - Id if instance to shutdown.

stopAllInstances

public void stopAllInstances()
Stop all running instances.


rebootInstance

public void rebootInstance(java.lang.String instanceId)
Reboot an instance.

Parameters:
instanceId - Id if instance to reboot.

getTimeZone

public java.util.TimeZone getTimeZone()
Helper functions, gets the current timezone to display dates correctly.

Returns:

createGroup

public void createGroup(java.lang.String name,
                        java.lang.String description)
Create a new security group


deleteGroup

public void deleteGroup(java.lang.String name)
Delete a security group


removePermission

public void removePermission()
Remove a permission.

Parameters:
group -
permission -

createNewPermission

public void createNewPermission()
Initializes a new permission.


addPermission

public void addPermission()
Add a permission that was configured using a permissionConfiguration.


createKeypair

public void createKeypair(java.lang.String name)
Create a keypair and outject private key in component "privateKey".

Parameters:
name -

resetPrivateKey

public void resetPrivateKey()
Reset the private key.


deleteKeypair

public void deleteKeypair(com.xerox.amazonws.ec2.KeyPairInfo kp)

getAvailabilityZoneItems

public java.util.List<javax.faces.model.SelectItem> getAvailabilityZoneItems()
Return availability zones as list of SelectItems for displaying in a dropdown box.

Returns:

getConsoleOutput

public java.lang.String getConsoleOutput(java.lang.String instanceId)
Read console output for an instance and assign it to outjected variable.

Parameters:
instanceId -


Copyright © 2010 just works! Software. All Rights Reserved.